diff --git a/cms/djangoapps/contentstore/tests/test_i18n.py b/cms/djangoapps/contentstore/tests/test_i18n.py index afa4e03f02..fdab4aef83 100644 --- a/cms/djangoapps/contentstore/tests/test_i18n.py +++ b/cms/djangoapps/contentstore/tests/test_i18n.py @@ -184,7 +184,7 @@ class InternationalizationTest(ModuleStoreTestCase): self.uname = 'testuser' self.email = 'test+courses@edx.org' - self.password = 'Password1234' + self.password = self.TEST_PASSWORD # Create the use so we can log them in. self.user = UserFactory.create(username=self.uname, email=self.email, password=self.password) diff --git a/lms/djangoapps/course_api/tests/mixins.py b/lms/djangoapps/course_api/tests/mixins.py index 2940826c68..46671867b7 100644 --- a/lms/djangoapps/course_api/tests/mixins.py +++ b/lms/djangoapps/course_api/tests/mixins.py @@ -8,7 +8,7 @@ from datetime import datetime from common.djangoapps.student.tests.factories import UserFactory, CourseEnrollmentFactory, CourseAccessRoleFactory from xmodule.modulestore.tests.factories import ToyCourseFactory # lint-amnesty, pylint: disable=wrong-import-order -TEST_PASSWORD = 'edx' +TEST_PASSWORD = 'Password1234' class CourseApiFactoryMixin: diff --git a/lms/djangoapps/course_blocks/transformers/tests/helpers.py b/lms/djangoapps/course_blocks/transformers/tests/helpers.py index 4060052be8..fb78946280 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/helpers.py +++ b/lms/djangoapps/course_blocks/transformers/tests/helpers.py @@ -50,7 +50,7 @@ class CourseStructureTestCase(TransformerRegistryTestMixin, ModuleStoreTestCase) """ super().setUp() # Set up users. - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.user = UserFactory.create(password=self.password) self.staff = UserFactory.create(password=self.password, is_staff=True) @@ -253,7 +253,7 @@ class BlockParentsMapTestCase(TransformerRegistryTestMixin, ModuleStoreTestCase) parent_block.children.append(self.xblock_keys[i]) update_block(parent_block) - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.student = UserFactory.create(is_staff=False, username='test_student', password=self.password) self.staff = UserFactory.create(is_staff=True, username='test_staff', password=self.password) CourseEnrollmentFactory.create( diff --git a/lms/djangoapps/course_wiki/tests/tests.py b/lms/djangoapps/course_wiki/tests/tests.py index f81b285afd..7fc86947d4 100644 --- a/lms/djangoapps/course_wiki/tests/tests.py +++ b/lms/djangoapps/course_wiki/tests/tests.py @@ -24,7 +24,7 @@ class WikiRedirectTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCas # Create two accounts self.student = 'view@test.com' self.instructor = 'view2@test.com' - self.password = 'Password1234' + self.password = self.TEST_PASSWORD for username, email in [('u1', self.student), ('u2', self.instructor)]: self.create_account(username, email, self.password) self.activate_user(email) diff --git a/lms/djangoapps/courseware/tests/test_submitting_problems.py b/lms/djangoapps/courseware/tests/test_submitting_problems.py index dee37a09c1..4d55645d7a 100644 --- a/lms/djangoapps/courseware/tests/test_submitting_problems.py +++ b/lms/djangoapps/courseware/tests/test_submitting_problems.py @@ -154,7 +154,7 @@ class TestSubmittingProblems(ModuleStoreTestCase, LoginEnrollmentTestCase, Probl # create a test student self.course = CourseFactory.create(display_name=self.COURSE_NAME, number=self.COURSE_SLUG) self.student = 'view@test.com' - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.create_account('u1', self.student, self.password) self.activate_user(self.student) self.enroll(self.course) diff --git a/lms/djangoapps/grades/rest_api/v1/tests/test_views.py b/lms/djangoapps/grades/rest_api/v1/tests/test_views.py index e5d82998b6..cd2107ec7c 100644 --- a/lms/djangoapps/grades/rest_api/v1/tests/test_views.py +++ b/lms/djangoapps/grades/rest_api/v1/tests/test_views.py @@ -548,7 +548,7 @@ class CourseSubmissionHistoryWithDataTest(TestSubmittingProblems): def setUp(self): super().setUp() self.namespaced_url = 'grades_api:v1:submission_history' - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.basic_setup() self.global_staff = GlobalStaffFactory.create() diff --git a/lms/djangoapps/mobile_api/testutils.py b/lms/djangoapps/mobile_api/testutils.py index abd4e0a4e0..f74d4b45a5 100644 --- a/lms/djangoapps/mobile_api/testutils.py +++ b/lms/djangoapps/mobile_api/testutils.py @@ -50,7 +50,7 @@ class MobileAPITestCase(ModuleStoreTestCase, APITestCase): certificate_available_date=datetime.datetime.now(pytz.UTC) ) self.user = UserFactory.create() - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.username = self.user.username self.api_version = API_V1 IgnoreMobileAvailableFlagConfig(enabled=False).save() diff --git a/lms/djangoapps/survey/tests/test_utils.py b/lms/djangoapps/survey/tests/test_utils.py index 5a940a8901..ce35474d6d 100644 --- a/lms/djangoapps/survey/tests/test_utils.py +++ b/lms/djangoapps/survey/tests/test_utils.py @@ -28,7 +28,7 @@ class SurveyModelsTests(ModuleStoreTestCase): self.client = Client() # Create two accounts - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.student = UserFactory.create( username='student', email='student@test.com', password=self.password, ) diff --git a/lms/djangoapps/survey/tests/test_views.py b/lms/djangoapps/survey/tests/test_views.py index 9f537de465..07ddd34e05 100644 --- a/lms/djangoapps/survey/tests/test_views.py +++ b/lms/djangoapps/survey/tests/test_views.py @@ -29,7 +29,7 @@ class SurveyViewsTests(ModuleStoreTestCase): self.client = Client() # Create two accounts - self.password = 'Password1234' + self.password = self.TEST_PASSWORD self.student = UserFactory.create(username='student', email='student@test.com', password=self.password) self.test_survey_name = 'TestSurvey' diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index c537ff6fc2..77ee515d37 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -93,6 +93,8 @@ l8N6+LEIVTMAytPk+/bImHvGHKZkCz5rEMSuYJWOmqKI92rUtI6fz5DUb3XSbrwT 3W+sdGFUK3GH1NAX71VxbAlFVLUetcMwai1+wXmGkRw6A7YezVFnhw== -----END RSA PRIVATE KEY-----""" +TEST_PASSWORD = 'Password1234' + def _mock_payment_processors(): """ @@ -122,8 +124,8 @@ class StartView(TestCase): Test the case where the user has no pending `PhotoVerificationAttempts`, but is just starting their first. """ - UserFactory.create(username="rusty", password='Password1234') - self.client.login(username="rusty", password='Password1234') + UserFactory.create(username="rusty", password=TEST_PASSWORD) + self.client.login(username="rusty", password=TEST_PASSWORD) def must_be_logged_in(self): self.assertHttpForbidden(self.client.get(self.start_url())) # lint-amnesty, pylint: disable=no-member @@ -1055,11 +1057,11 @@ class CheckoutTestMixin: """ Create a user and course. """ super().setUp() - self.user = UserFactory.create(username="test", password='Password1234') + self.user = UserFactory.create(username="test", password=TEST_PASSWORD) self.course = CourseFactory.create() for mode, min_price in (('audit', 0), ('honor', 0), ('verified', 100)): CourseModeFactory.create(mode_slug=mode, course_id=self.course.id, min_price=min_price, sku=self.make_sku()) - self.client.login(username="test", password='Password1234') + self.client.login(username="test", password=TEST_PASSWORD) def _assert_checked_out( self, @@ -1868,7 +1870,7 @@ class TestPhotoURLView(TestVerificationBase): super().setUp() self.user = AdminFactory() - login_success = self.client.login(username=self.user.username, password='Password1234') + login_success = self.client.login(username=self.user.username, password=TEST_PASSWORD) assert login_success self.attempt = SoftwareSecurePhotoVerification( status="submitted", @@ -1895,7 +1897,7 @@ class TestPhotoURLView(TestVerificationBase): def test_403_for_non_staff(self): self.user = UserFactory() - login_success = self.client.login(username=self.user.username, password='Password1234') + login_success = self.client.login(username=self.user.username, password=TEST_PASSWORD) assert login_success url = reverse('verification_photo_urls', kwargs={'receipt_id': str(self.receipt_id)}) response = self.client.get(url) @@ -1934,7 +1936,7 @@ class TestDecodeImageViews(MockS3Boto3Mixin, TestVerificationBase): def setUp(self): super().setUp() self.user = AdminFactory() - login_success = self.client.login(username=self.user.username, password='Password1234') + login_success = self.client.login(username=self.user.username, password=TEST_PASSWORD) assert login_success def _mock_submit_images(self): @@ -1995,7 +1997,7 @@ class TestDecodeImageViews(MockS3Boto3Mixin, TestVerificationBase): @ddt.data("face", "photo_id") def test_403_for_non_staff(self, img_type): self.user = UserFactory() - login_success = self.client.login(username=self.user.username, password='Password1234') + login_success = self.client.login(username=self.user.username, password=TEST_PASSWORD) assert login_success self._mock_submit_images() diff --git a/openedx/tests/xblock_integration/test_crowdsource_hinter.py b/openedx/tests/xblock_integration/test_crowdsource_hinter.py index cf2cc368e6..61f1097481 100644 --- a/openedx/tests/xblock_integration/test_crowdsource_hinter.py +++ b/openedx/tests/xblock_integration/test_crowdsource_hinter.py @@ -21,8 +21,8 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): Create the test environment with the crowdsourcehinter xblock. """ STUDENTS = [ - {'email': 'view@test.com', 'password': 'Password1234'}, - {'email': 'view2@test.com', 'password': 'Password1234'} + {'email': 'view@test.com', 'password': SharedModuleStoreTestCase.TEST_PASSWORD}, + {'email': 'view2@test.com', 'password': SharedModuleStoreTestCase.TEST_PASSWORD} ] XBLOCK_NAMES = ['crowdsourcehinter']