Skip to content

Commit 6d0d910

Browse files
fix: use consistent password in CourseUpdateAuthzTest (#38228)
1 parent 46b1e04 commit 6d0d910

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

cms/djangoapps/contentstore/views/tests/test_course_updates.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def create_update_url(self, provided_id=None):
336336

337337
def setUp(self):
338338
super().setUp()
339-
self.auditor_user = UserFactory()
339+
self.auditor_user = UserFactory(password=self.password)
340340
self.add_user_to_role(self.auditor_user, COURSE_AUDITOR.external_key)
341341

342342
self.staff_client = self._make_client_for_user(self.authorized_user)
@@ -345,7 +345,7 @@ def setUp(self):
345345

346346
def _make_client_for_user(self, user):
347347
client = AjaxEnabledTestClient()
348-
client.login(username=user.username, password='Password1234')
348+
client.login(username=user.username, password=self.password)
349349
return client
350350

351351
def _create_update(self, client):
@@ -417,25 +417,25 @@ def test_unauthorized_user_cannot_post(self):
417417
# -- Staff/superuser without authz role: access via enforcer admin check --
418418

419419
def test_django_staff_without_role_can_get(self):
420-
staff_user = UserFactory(is_staff=True)
420+
staff_user = UserFactory(is_staff=True, password=self.password)
421421
client = self._make_client_for_user(staff_user)
422422
resp = client.get_json(self.create_update_url())
423423
self.assertEqual(resp.status_code, 200)
424424

425425
def test_django_staff_without_role_can_post(self):
426-
staff_user = UserFactory(is_staff=True)
426+
staff_user = UserFactory(is_staff=True, password=self.password)
427427
client = self._make_client_for_user(staff_user)
428428
resp = self._create_update(client)
429429
self.assertEqual(resp.status_code, 200)
430430

431431
def test_superuser_without_role_can_get(self):
432-
superuser = UserFactory(is_superuser=True)
432+
superuser = UserFactory(is_superuser=True, password=self.password)
433433
client = self._make_client_for_user(superuser)
434434
resp = client.get_json(self.create_update_url())
435435
self.assertEqual(resp.status_code, 200)
436436

437437
def test_superuser_without_role_can_post(self):
438-
superuser = UserFactory(is_superuser=True)
438+
superuser = UserFactory(is_superuser=True, password=self.password)
439439
client = self._make_client_for_user(superuser)
440440
resp = self._create_update(client)
441441
self.assertEqual(resp.status_code, 200)

0 commit comments

Comments
 (0)