Skip to content

Commit 00bafa5

Browse files
committed
Fix unit tests broken by implementing impersonation
1 parent d363d80 commit 00bafa5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cmstestsuite/unit_tests/server/contest/authentication_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,14 @@ def assertSuccess(self, **kwargs):
192192
self.session.expire(self.user)
193193
self.session.expire(self.contest)
194194

195-
authenticated_participation, cookie = \
195+
authenticated_participation, cookie, impersonated = \
196196
self.attempt_authentication(**kwargs)
197197

198198
self.assertIsNotNone(authenticated_participation)
199199
self.assertIs(authenticated_participation, self.participation)
200200
self.assertIs(authenticated_participation.user, self.user)
201201
self.assertIs(authenticated_participation.contest, self.contest)
202+
self.assertIs(impersonated, False)
202203

203204
return cookie
204205

@@ -223,10 +224,11 @@ def assertSuccessAndCookieCleared(self, **kwargs):
223224
def assertFailure(self, **kwargs):
224225
# Assert that the authentication fails.
225226
# The arguments are the same as those of attempt_authentication.
226-
authenticated_participation, cookie = \
227+
authenticated_participation, cookie, impersonated = \
227228
self.attempt_authentication(**kwargs)
228229
self.assertIsNone(authenticated_participation)
229230
self.assertIsNone(cookie)
231+
self.assertIs(impersonated, False)
230232

231233
@patch.object(config, "cookie_duration", 10)
232234
def test_cookie_contains_timestamp(self):

0 commit comments

Comments
 (0)