From f0fd977656adb9f5b160100adbc8d3978d25b36d Mon Sep 17 00:00:00 2001 From: Alan Crosswell Date: Fri, 7 Jun 2024 16:44:24 -0400 Subject: [PATCH] resolve missing user from test case access token --- myapp/tests/test_views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/myapp/tests/test_views.py b/myapp/tests/test_views.py index 6428f3c..7d9b963 100644 --- a/myapp/tests/test_views.py +++ b/myapp/tests/test_views.py @@ -112,6 +112,7 @@ def setUp(self): # most tests just use the read_write_user self.user1_token = oauth_models.MyAccessToken( # nosec B106 token='User1Token', + user=self.read_write_user, expires=datetime.isoformat(datetime.now(tz=timezone.utc)+timedelta(seconds=3600)), scope='auth-columbia demo-djt-sla-bronze read create update openid ' 'profile email https://api.columbia.edu/scope/group', @@ -291,6 +292,7 @@ def test_filter_fields_intersection(self): data={"filter[subject_area_code]": "ANTB", "filter[school_bulletin_prefix_code]": "XCEFK9"}, **HEADERS) + self.assertEqual(response.status_code, 200) j = json.loads(response.content) self.assertEqual( len(j['data']), @@ -307,6 +309,7 @@ def test_sparse_fieldsets(self): response = self.client.get("{}{}/".format(self.courses_url, self.courses[5].id), data={"fields[courses]": "course_name,course_description"}, **HEADERS) + self.assertEqual(response.status_code, 200) j = json.loads(response.content) self.assertEqual(len(j['data']['attributes']), 2) self.assertIn('course_name', j['data']['attributes'])