diff --git a/integration/tests/posit/connect/test_vanities.py b/integration/tests/posit/connect/test_vanities.py index e72c725a..b79d43cc 100644 --- a/integration/tests/posit/connect/test_vanities.py +++ b/integration/tests/posit/connect/test_vanities.py @@ -66,6 +66,7 @@ def test_destroy(self): # Delete vanity.destroy() + content.reset_vanity() assert content.vanity is None # Cleanup diff --git a/src/posit/connect/vanities.py b/src/posit/connect/vanities.py index 487622a9..fcacde25 100644 --- a/src/posit/connect/vanities.py +++ b/src/posit/connect/vanities.py @@ -142,6 +142,7 @@ def vanity(self) -> Optional[str]: try: self._vanity = self.find_vanity() + self._vanity._after_destroy = self.reset_vanity return self._vanity["path"] except ClientError as e: if e.http_status == 404: @@ -232,4 +233,4 @@ def find_vanity(self) -> Vanity: """ response = self.params.session.get(self._endpoint) result = response.json() - return Vanity(self.params, after_destroy=self.reset_vanity, **result) + return Vanity(self.params, **result)