Skip to content

Commit

Permalink
resolve missing user from test case access token
Browse files Browse the repository at this point in the history
  • Loading branch information
n2ygk committed Jun 7, 2024
1 parent 89d3f7c commit f0fd977
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions myapp/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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']),
Expand All @@ -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'])
Expand Down

0 comments on commit f0fd977

Please sign in to comment.