diff --git a/ietf/api/tests.py b/ietf/api/tests.py index b8b69f8345..724a0b9d1e 100644 --- a/ietf/api/tests.py +++ b/ietf/api/tests.py @@ -1096,13 +1096,11 @@ def test_rfc_authors(self): two_days_ago = now - datetime.timedelta(days=2) three_days_ago = now - datetime.timedelta(days=3) long_long_ago = now - datetime.timedelta(days=400) - + # A recently published RFC with a known author... author = PersonFactory(name="Jane Q. Author") recent_rfc = WgRfcFactory(title="A Recently Published RFC") - recent_event = DocEventFactory( - doc=recent_rfc, type="published_rfc", time=two_days_ago - ) + DocEventFactory(doc=recent_rfc, type="published_rfc", time=two_days_ago) RfcAuthorFactory(document=recent_rfc, person=author) # ...and an RFC published well outside the default window, which must be excluded. @@ -1127,7 +1125,7 @@ def test_rfc_authors(self): row["rfc_number_and_title"], f"RFC {recent_rfc.rfc_number}: {recent_rfc.title}", ) - self.assertEqual(row["published_date"], str(recent_event.time.date())) + self.assertEqual(row["published_date"], str(recent_rfc.pub_date())) # A narrow window excludes the recent RFC, too. First, using from-only r = self.client.get( @@ -1211,7 +1209,6 @@ def test_rfc_authors(self): headers={"X-Api-Key": "valid-token"}, ) self.assertEqual(r.status_code, 400, "out-of-order from/to parameters") - @override_settings( APP_API_TOKENS={"ietf.api.views.ingest_email": "valid-token", "ietf.api.views.ingest_email_test": "test-token"}