diff --git a/src/registrar/models/domain.py b/src/registrar/models/domain.py index 005682e23..483fc74f9 100644 --- a/src/registrar/models/domain.py +++ b/src/registrar/models/domain.py @@ -218,7 +218,7 @@ class Domain(TimeStampedModel, DomainHelper): def registry_expiration_date(self, ex_date: date): """ Direct setting of the expiration date in the registry is not implemented. - + To update the expiration date, use renew_domain method.""" raise NotImplementedError() @@ -226,7 +226,7 @@ class Domain(TimeStampedModel, DomainHelper): """ Renew the domain to a length and unit of time relative to the current expiration date. - + Default length and unit of time are 1 year. """ # if no expiration date from registry, set to today @@ -236,11 +236,7 @@ class Domain(TimeStampedModel, DomainHelper): cur_exp_date = date.today() # create RenewDomain request - request = commands.RenewDomain( - name=self.name, - cur_exp_date=cur_exp_date, - period = epp.Period(length, unit) - ) + request = commands.RenewDomain(name=self.name, cur_exp_date=cur_exp_date, period=epp.Period(length, unit)) try: # update expiration date in registry, and set the updated diff --git a/src/registrar/tests/common.py b/src/registrar/tests/common.py index 3036bb97c..9a062106f 100644 --- a/src/registrar/tests/common.py +++ b/src/registrar/tests/common.py @@ -907,7 +907,7 @@ class MockEppLib(TestCase): res_data=[self.mockRenewedDomainExpDate], code=ErrorCode.COMMAND_COMPLETED_SUCCESSFULLY, ) - + def mockInfoDomainCommands(self, _request, cleaned): request_name = getattr(_request, "name", None) diff --git a/src/registrar/tests/test_models_domain.py b/src/registrar/tests/test_models_domain.py index 8f126b74a..c75b1b935 100644 --- a/src/registrar/tests/test_models_domain.py +++ b/src/registrar/tests/test_models_domain.py @@ -1972,7 +1972,7 @@ class TestExpirationDate(MockEppLib): def test_expiration_date_setter_not_implemented(self): """assert that the setter for expiration date is not implemented and will raise error""" - with self.assertRaises(NotImplementedError) as err: + with self.assertRaises(NotImplementedError): self.domain.registry_expiration_date = datetime.date.today() def test_renew_domain(self): @@ -1984,10 +1984,10 @@ class TestExpirationDate(MockEppLib): def test_renew_domain_error(self): """assert that the renew_domain raises an exception when registry raises error""" - with self.assertRaises(RegistryError) as err: + with self.assertRaises(RegistryError): self.domain_w_error.renew_domain() - + class TestAnalystClientHold(MockEppLib): """Rule: Analysts may suspend or restore a domain by using client hold"""