From 64e91d4080870135988bb27d8075eaf514e6f95f Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 11 Oct 2023 13:44:09 -0400 Subject: [PATCH] test: Update to an even longer password. --- .../contentstore/tests/test_i18n.py | 2 +- common/djangoapps/student/tests/factories.py | 4 +-- .../student/tests/test_admin_views.py | 4 +-- common/djangoapps/student/tests/test_email.py | 6 ++-- .../student/tests/test_retirement.py | 2 +- .../student/tests/test_userstanding.py | 2 +- .../third_party_auth/tests/specs/base.py | 2 +- .../third_party_auth/tests/test_admin.py | 2 +- lms/djangoapps/ccx/api/v0/tests/test_views.py | 2 +- lms/djangoapps/ccx/tests/test_views.py | 2 +- .../commerce/api/v1/tests/test_views.py | 2 +- lms/djangoapps/commerce/tests/test_views.py | 2 +- .../transformers/tests/helpers.py | 4 +-- lms/djangoapps/course_wiki/tests/tests.py | 2 +- lms/djangoapps/courseware/tests/helpers.py | 2 +- lms/djangoapps/courseware/tests/test_about.py | 2 +- .../courseware/tests/test_course_survey.py | 2 +- .../tests/test_submitting_problems.py | 2 +- .../tests/test_view_authentication.py | 2 +- lms/djangoapps/courseware/testutils.py | 2 +- .../django_comment_client/base/tests.py | 4 +-- .../discussion/rest_api/tests/test_views.py | 34 +++++++++---------- .../grades/rest_api/v1/tests/mixins.py | 2 +- .../grades/rest_api/v1/tests/test_views.py | 2 +- .../tests/test_views.py | 6 ++-- lms/djangoapps/mobile_api/testutils.py | 2 +- lms/djangoapps/survey/tests/test_models.py | 2 +- lms/djangoapps/survey/tests/test_utils.py | 2 +- lms/djangoapps/survey/tests/test_views.py | 2 +- .../verify_student/tests/test_views.py | 16 ++++----- .../notifications/tests/test_views.py | 6 ++-- .../tests/test_dot_overrides.py | 6 ++-- .../oauth_dispatch/tests/test_views.py | 2 +- .../safe_sessions/tests/test_middleware.py | 4 +-- .../tests/test_theme_style_overrides.py | 2 +- .../djangoapps/theming/tests/test_views.py | 2 +- .../user_api/accounts/tests/test_api.py | 2 +- .../djangoapps/user_api/tests/test_views.py | 2 +- .../verification_api/tests/test_views.py | 2 +- .../core/djangoapps/user_authn/tests/utils.py | 2 +- .../user_authn/views/tests/test_password.py | 4 +-- .../tests/views/test_course_sock.py | 2 +- .../tests/views/test_masquerade.py | 2 +- .../test_crowdsource_hinter.py | 4 +-- .../xblock_integration/test_recommender.py | 4 +-- .../xblock_integration/xblock_testcase.py | 6 ++-- xmodule/modulestore/tests/django_utils.py | 2 +- 47 files changed, 88 insertions(+), 88 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_i18n.py b/cms/djangoapps/contentstore/tests/test_i18n.py index be2003f981..afa4e03f02 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 = 'password' + self.password = 'Password1234' # 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/common/djangoapps/student/tests/factories.py b/common/djangoapps/student/tests/factories.py index 506d1818e4..27e245288d 100644 --- a/common/djangoapps/student/tests/factories.py +++ b/common/djangoapps/student/tests/factories.py @@ -35,7 +35,7 @@ from common.djangoapps.student.roles import OrgStaffRole from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory -TEST_PASSWORD = 'password' +TEST_PASSWORD = 'Password1234' class GroupFactory(DjangoModelFactory): # lint-amnesty, pylint: disable=missing-class-docstring @@ -81,7 +81,7 @@ class UserFactory(DjangoModelFactory): # lint-amnesty, pylint: disable=missing- model = User django_get_or_create = ('email', 'username') - _DEFAULT_PASSWORD = 'password' + _DEFAULT_PASSWORD = 'Password1234' username = factory.Sequence('robot{}'.format) email = factory.Sequence('robot+test+{}@edx.org'.format) diff --git a/common/djangoapps/student/tests/test_admin_views.py b/common/djangoapps/student/tests/test_admin_views.py index 7ae693606d..2914bcd61c 100644 --- a/common/djangoapps/student/tests/test_admin_views.py +++ b/common/djangoapps/student/tests/test_admin_views.py @@ -324,9 +324,9 @@ class LoginFailuresAdminTest(TestCase): def setUpClass(cls): """Setup class""" super().setUpClass() - cls.user = UserFactory.create(username='§', is_staff=True, is_superuser=True) + cls.TEST_PASSWORD = 'Password1234' + cls.user = UserFactory.create(username='§', password=cls.TEST_PASSWORD, is_staff=True, is_superuser=True) cls.user.save() - cls.TEST_PASSWORD = 'password' def setUp(self): """Setup.""" diff --git a/common/djangoapps/student/tests/test_email.py b/common/djangoapps/student/tests/test_email.py index f39591c779..bcede18213 100644 --- a/common/djangoapps/student/tests/test_email.py +++ b/common/djangoapps/student/tests/test_email.py @@ -136,7 +136,7 @@ class ActivationEmailTests(EmailTemplateTagMixin, CacheIsolationTestCase): params = { 'username': 'test_user', 'email': 'test_user@example.com', - 'password': 'long_password', + 'password': 'Password1234', 'name': 'Test User', 'honor_code': True, 'terms_of_service': True @@ -319,7 +319,7 @@ class EmailChangeRequestTests(EventTestMixin, EmailTemplateTagMixin, CacheIsolat self.new_email = 'new.email@edx.org' self.req_factory = RequestFactory() self.request = self.req_factory.post('unused_url', data={ - 'password': 'test', + 'password': 'Password1234', 'new_email': self.new_email }) self.request.user = self.user @@ -628,7 +628,7 @@ class SecondaryEmailChangeRequestTests(EventTestMixin, EmailTemplateTagMixin, Ca self.new_secondary_email = 'new.secondary.email@edx.org' self.req_factory = RequestFactory() self.request = self.req_factory.post('unused_url', data={ - 'password': 'test', + 'password': 'Password1234', 'new_email': self.new_secondary_email }) self.request.user = self.user diff --git a/common/djangoapps/student/tests/test_retirement.py b/common/djangoapps/student/tests/test_retirement.py index 96c0034a0e..ffeb1af14f 100644 --- a/common/djangoapps/student/tests/test_retirement.py +++ b/common/djangoapps/student/tests/test_retirement.py @@ -260,7 +260,7 @@ class TestRegisterRetiredUsername(TestCase): 'username': 'username', 'email': 'foo_bar' + '@bar.com', 'name': 'foo bar', - 'password': '12345678', + 'password': 'Password1234', 'terms_of_service': 'true', 'honor_code': 'true', } diff --git a/common/djangoapps/student/tests/test_userstanding.py b/common/djangoapps/student/tests/test_userstanding.py index e7b9bab233..67fcebda28 100644 --- a/common/djangoapps/student/tests/test_userstanding.py +++ b/common/djangoapps/student/tests/test_userstanding.py @@ -43,7 +43,7 @@ class UserStandingTest(TestCase): (self.non_staff, self.non_staff_client), (self.admin, self.admin_client), ]: - client.login(username=user.username, password='password') + client.login(username=user.username, password='Password1234') UserStandingFactory.create( user=self.bad_user, diff --git a/common/djangoapps/third_party_auth/tests/specs/base.py b/common/djangoapps/third_party_auth/tests/specs/base.py index 4974627fd0..8f96235017 100644 --- a/common/djangoapps/third_party_auth/tests/specs/base.py +++ b/common/djangoapps/third_party_auth/tests/specs/base.py @@ -481,7 +481,7 @@ class IntegrationTestMixin(testutil.TestCase, test.TestCase, HelperMixin): # The AJAX on the page will log them in: ajax_login_response = self.client.post( reverse('user_api_login_session', kwargs={'api_version': 'v1'}), - {'email': self.user.email, 'password': 'password'} + {'email': self.user.email, 'password': 'Password1234'} ) assert ajax_login_response.status_code == 200 # Then the AJAX will finish the third party auth: diff --git a/common/djangoapps/third_party_auth/tests/test_admin.py b/common/djangoapps/third_party_auth/tests/test_admin.py index a1b2e2235d..0acfb3492a 100644 --- a/common/djangoapps/third_party_auth/tests/test_admin.py +++ b/common/djangoapps/third_party_auth/tests/test_admin.py @@ -14,7 +14,7 @@ from common.djangoapps.third_party_auth.tests import testutil from common.djangoapps.third_party_auth.tests.utils import skip_unless_thirdpartyauth -TEST_PASSWORD = 'password' +TEST_PASSWORD = 'Password1234' # This is necessary because cms does not implement third party auth diff --git a/lms/djangoapps/ccx/api/v0/tests/test_views.py b/lms/djangoapps/ccx/api/v0/tests/test_views.py index 195fafb11c..7279b94263 100644 --- a/lms/djangoapps/ccx/api/v0/tests/test_views.py +++ b/lms/djangoapps/ccx/api/v0/tests/test_views.py @@ -33,7 +33,7 @@ from lms.djangoapps.instructor.access import allow_access, list_with_level from lms.djangoapps.instructor.enrollment import enroll_email, get_email_params from openedx.core.lib.courses import get_course_by_id -USER_PASSWORD = 'password' +USER_PASSWORD = 'Password1234' class CcxRestApiTest(CcxTestCase, APITestCase): diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 6dd569c0fb..e993d5dc0b 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -129,7 +129,7 @@ class TestAdminAccessCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): ccx = self.make_ccx() ccx_key = CCXLocator.from_course_locator(self.course.id, ccx.id) self.url = reverse('ccx_coach_dashboard', kwargs={'course_id': ccx_key}) - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' def test_staff_access_coach_dashboard(self): """ diff --git a/lms/djangoapps/commerce/api/v1/tests/test_views.py b/lms/djangoapps/commerce/api/v1/tests/test_views.py index 68f3d92d52..0d9557c31a 100644 --- a/lms/djangoapps/commerce/api/v1/tests/test_views.py +++ b/lms/djangoapps/commerce/api/v1/tests/test_views.py @@ -23,7 +23,7 @@ from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, p from ....tests.mocks import mock_order_endpoint from ....tests.test_views import UserMixin -PASSWORD = 'password' +PASSWORD = 'Password1234' JSON_CONTENT_TYPE = 'application/json' diff --git a/lms/djangoapps/commerce/tests/test_views.py b/lms/djangoapps/commerce/tests/test_views.py index 8932c826c7..410d2520cc 100644 --- a/lms/djangoapps/commerce/tests/test_views.py +++ b/lms/djangoapps/commerce/tests/test_views.py @@ -3,7 +3,7 @@ from common.djangoapps.student.tests.factories import UserFactory -TEST_PASSWORD = "password" +TEST_PASSWORD = "Password1234" class UserMixin: diff --git a/lms/djangoapps/course_blocks/transformers/tests/helpers.py b/lms/djangoapps/course_blocks/transformers/tests/helpers.py index 29c15e8289..4060052be8 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 = 'password' + self.password = 'Password1234' 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 = 'password' + self.password = 'Password1234' 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 1afdea5d74..f81b285afd 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 = 'password' + self.password = 'Password1234' 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/helpers.py b/lms/djangoapps/courseware/tests/helpers.py index 30398dad3c..1ab77ff93d 100644 --- a/lms/djangoapps/courseware/tests/helpers.py +++ b/lms/djangoapps/courseware/tests/helpers.py @@ -173,7 +173,7 @@ class LoginEnrollmentTestCase(TestCase): Create a user account, activate, and log in. """ self.email = 'foo@test.com' # lint-amnesty, pylint: disable=attribute-defined-outside-init - self.password = 'password' # lint-amnesty, pylint: disable=attribute-defined-outside-init + self.password = 'Password1234' # lint-amnesty, pylint: disable=attribute-defined-outside-init self.username = 'test' # lint-amnesty, pylint: disable=attribute-defined-outside-init self.user = self.create_account( self.username, diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py index f6c71119a7..d53d620d3e 100644 --- a/lms/djangoapps/courseware/tests/test_about.py +++ b/lms/djangoapps/courseware/tests/test_about.py @@ -284,7 +284,7 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleSt # pylint: disable=attribute-defined-outside-init # create a new account since the first account is already enrolled in the course self.email = 'foo_second@test.com' - self.password = 'password' + self.password = 'Password1234' self.username = 'test_second' self.create_account(self.username, self.email, self.password) self.activate_user(self.email) diff --git a/lms/djangoapps/courseware/tests/test_course_survey.py b/lms/djangoapps/courseware/tests/test_course_survey.py index e5aa97cfaa..98b5842cd2 100644 --- a/lms/djangoapps/courseware/tests/test_course_survey.py +++ b/lms/djangoapps/courseware/tests/test_course_survey.py @@ -22,7 +22,7 @@ class SurveyViewsTests(LoginEnrollmentTestCase, SharedModuleStoreTestCase, XssTe """ All tests for the views.py file """ - STUDENT_INFO = [('view@test.com', 'password1234')] + STUDENT_INFO = [('view@test.com', 'Password1234')] @classmethod def setUpClass(cls): diff --git a/lms/djangoapps/courseware/tests/test_submitting_problems.py b/lms/djangoapps/courseware/tests/test_submitting_problems.py index 9536067f52..dee37a09c1 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 = 'password' + self.password = 'Password1234' self.create_account('u1', self.student, self.password) self.activate_user(self.student) self.enroll(self.course) diff --git a/lms/djangoapps/courseware/tests/test_view_authentication.py b/lms/djangoapps/courseware/tests/test_view_authentication.py index aa53561ee5..67ada18e85 100644 --- a/lms/djangoapps/courseware/tests/test_view_authentication.py +++ b/lms/djangoapps/courseware/tests/test_view_authentication.py @@ -29,7 +29,7 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro Check that view authentication works properly. """ - ACCOUNT_INFO = [('view@test.com', 'password1234'), ('view2@test.com', 'password1234')] + ACCOUNT_INFO = [('view@test.com', 'Password1234'), ('view2@test.com', 'Password1234')] ENABLED_SIGNALS = ['course_published'] @staticmethod diff --git a/lms/djangoapps/courseware/testutils.py b/lms/djangoapps/courseware/testutils.py index 36774447fe..a18074e9cc 100644 --- a/lms/djangoapps/courseware/testutils.py +++ b/lms/djangoapps/courseware/testutils.py @@ -81,7 +81,7 @@ class RenderXBlockTestMixin(MasqueradeMixin, metaclass=ABCMeta): """ Logs in the test user. """ - self.client.login(username=self.user.username, password='password') + self.client.login(username=self.user.username, password='Password1234') def course_options(self): """ diff --git a/lms/djangoapps/discussion/django_comment_client/base/tests.py b/lms/djangoapps/discussion/django_comment_client/base/tests.py index ea712e0852..dcf473a548 100644 --- a/lms/djangoapps/discussion/django_comment_client/base/tests.py +++ b/lms/djangoapps/discussion/django_comment_client/base/tests.py @@ -241,7 +241,7 @@ class ViewsTestCaseMixin: with patch('common.djangoapps.student.models.user.cc.User.save'): uname = 'student' email = 'student@edx.org' - self.password = 'password' + self.password = 'Password1234' # Create the user and make them active so we can log them in. self.student = UserFactory.create(username=uname, email=email, password=self.password) @@ -464,7 +464,7 @@ class ViewsTestCase( with patch('common.djangoapps.student.models.user.cc.User.save'): uname = 'student' email = 'student@edx.org' - self.password = 'password' + self.password = 'Password1234' # Create the user and make them active so we can log them in. self.student = UserFactory.create(username=uname, email=email, password=self.password) diff --git a/lms/djangoapps/discussion/rest_api/tests/test_views.py b/lms/djangoapps/discussion/rest_api/tests/test_views.py index 3fe9d64450..8f6c464c3e 100644 --- a/lms/djangoapps/discussion/rest_api/tests/test_views.py +++ b/lms/djangoapps/discussion/rest_api/tests/test_views.py @@ -87,7 +87,7 @@ class DiscussionAPIViewTestMixin(ForumsEnableMixin, CommentsServiceMockMixin, Ur start=datetime.now(UTC), discussion_topics={"Test Topic": {"id": "test_topic"}} ) - self.password = "password" + self.password = "Password1234" self.user = UserFactory.create(password=self.password) # Ensure that parental controls don't apply to this user self.user.profile.year_of_birth = 1970 @@ -168,7 +168,7 @@ class UploadFileViewTest(ForumsEnableMixin, CommentsServiceMockMixin, UrlResetMi content_type="image/jpeg", ), } - self.user = UserFactory.create(password="password") + self.user = UserFactory.create(password=self.TEST_PASSWORD) self.course = CourseFactory.create(org='a', course='b', run='c', start=datetime.now(UTC)) self.url = reverse("upload_file", kwargs={"course_id": str(self.course.id)}) @@ -176,7 +176,7 @@ class UploadFileViewTest(ForumsEnableMixin, CommentsServiceMockMixin, UrlResetMi """ Authenticates the test client with the example user. """ - self.client.login(username=self.user.username, password="password") + self.client.login(username=self.user.username, password=self.TEST_PASSWORD) def enroll_user_in_course(self): """ @@ -320,10 +320,10 @@ class CommentViewSetListByUserTest( self.addCleanup(httpretty.reset) self.addCleanup(httpretty.disable) - self.user = UserFactory.create(password="password") + self.user = UserFactory.create(password=self.TEST_PASSWORD) self.register_get_user_response(self.user) - self.other_user = UserFactory.create(password="password") + self.other_user = UserFactory.create(password=self.TEST_PASSWORD) self.register_get_user_response(self.other_user) self.course = CourseFactory.create(org="a", course="b", run="c", start=datetime.now(UTC)) @@ -405,7 +405,7 @@ class CommentViewSetListByUserTest( they're not either enrolled or staff members. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) response = self.client.get(self.url) assert response.status_code == status.HTTP_404_NOT_FOUND assert json.loads(response.content)["developer_message"] == "Course not found." @@ -416,7 +416,7 @@ class CommentViewSetListByUserTest( comments in that course. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) CourseEnrollmentFactory.create(user=self.other_user, course_id=self.course.id) self.assert_successful_response(self.client.get(self.url)) @@ -425,7 +425,7 @@ class CommentViewSetListByUserTest( Staff users are allowed to get any user's comments. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) GlobalStaff().add_users(self.other_user) self.assert_successful_response(self.client.get(self.url)) @@ -436,7 +436,7 @@ class CommentViewSetListByUserTest( course. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) role(course_key=self.course.id).add_users(self.other_user) self.assert_successful_response(self.client.get(self.url)) @@ -445,7 +445,7 @@ class CommentViewSetListByUserTest( Requests for users that don't exist result in a 404 response. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) GlobalStaff().add_users(self.other_user) url = self.build_url("non_existent", self.course.id) response = self.client.get(url) @@ -456,7 +456,7 @@ class CommentViewSetListByUserTest( Requests for courses that don't exist result in a 404 response. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) GlobalStaff().add_users(self.other_user) url = self.build_url(self.user.username, "course-v1:x+y+z") response = self.client.get(url) @@ -467,7 +467,7 @@ class CommentViewSetListByUserTest( Requests with invalid course ID should fail form validation. """ self.register_mock_endpoints() - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) GlobalStaff().add_users(self.other_user) url = self.build_url(self.user.username, "an invalid course") response = self.client.get(url) @@ -484,7 +484,7 @@ class CommentViewSetListByUserTest( self.register_get_threads_response(threads=[], page=1, num_pages=1) self.register_get_comments_response(comments=[], page=1, num_pages=1) - self.client.login(username=self.other_user.username, password="password") + self.client.login(username=self.other_user.username, password=self.TEST_PASSWORD) GlobalStaff().add_users(self.other_user) url = self.build_url(self.user.username, self.course.id, page=2) response = self.client.get(url) @@ -929,7 +929,7 @@ class CourseTopicsViewV3Test(DiscussionAPIViewTestMixin, CommentsServiceMockMixi """ def setUp(self) -> None: super().setUp() - self.password = "password" + self.password = self.TEST_PASSWORD self.user = UserFactory.create(password=self.password) self.client.login(username=self.user.username, password=self.password) self.staff = AdminFactory.create() @@ -2758,7 +2758,7 @@ class CourseDiscussionSettingsAPIViewTest(APITestCase, UrlResetMixin, ModuleStor discussion_topics={"Test Topic": {"id": "test_topic"}} ) self.path = reverse('discussion_course_settings', kwargs={'course_id': str(self.course.id)}) - self.password = 'password' + self.password = self.TEST_PASSWORD self.user = UserFactory(username='staff', password=self.password, is_staff=True) def _get_oauth_headers(self, user): @@ -3056,7 +3056,7 @@ class CourseDiscussionRolesAPIViewTest(APITestCase, UrlResetMixin, ModuleStoreTe run="z", start=datetime.now(UTC), ) - self.password = 'password' + self.password = self.TEST_PASSWORD self.user = UserFactory(username='staff', password=self.password, is_staff=True) course_key = CourseKey.from_string('course-v1:x+y+z') seed_permissions_roles(course_key) @@ -3264,7 +3264,7 @@ class CourseActivityStatsTest(ForumsEnableMixin, UrlResetMixin, CommentsServiceM user = UserFactory.create( username=stat['username'], email=f"{stat['username']}@example.com", - password='12345' + password=self.TEST_PASSWORD ) CourseEnrollment.enroll(user, self.course.id, mode='audit') diff --git a/lms/djangoapps/grades/rest_api/v1/tests/mixins.py b/lms/djangoapps/grades/rest_api/v1/tests/mixins.py index 9131ebd290..1d3a6a0b45 100644 --- a/lms/djangoapps/grades/rest_api/v1/tests/mixins.py +++ b/lms/djangoapps/grades/rest_api/v1/tests/mixins.py @@ -97,7 +97,7 @@ class GradeViewTestMixin(SharedModuleStoreTestCase): def setUp(self): super().setUp() - self.password = 'password' + self.password = self.TEST_PASSWORD self.global_staff = GlobalStaffFactory.create() self.student = UserFactory(password=self.password, username='student', email='student@example.com') self.other_student = UserFactory( 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 0dd6ea2573..e5d82998b6 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 = 'password' + self.password = 'Password1234' self.basic_setup() self.global_staff = GlobalStaffFactory.create() diff --git a/lms/djangoapps/learner_recommendations/tests/test_views.py b/lms/djangoapps/learner_recommendations/tests/test_views.py index f2af2a7799..46c54dc90d 100644 --- a/lms/djangoapps/learner_recommendations/tests/test_views.py +++ b/lms/djangoapps/learner_recommendations/tests/test_views.py @@ -26,7 +26,7 @@ class TestRecommendationsBase(APITestCase): def setUp(self): super().setUp() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory(password=self.TEST_PASSWORD) self.client.login(username=self.user.username, password=self.TEST_PASSWORD) self.recommended_courses = [ @@ -164,7 +164,7 @@ class TestRecommendationsContextView(APITestCase): def setUp(self): super().setUp() self.user = UserFactory() - self.password = "password" + self.password = 'Password1234' self.url = reverse_lazy("learner_recommendations:recommendations_context") @mock.patch("lms.djangoapps.learner_recommendations.views.country_code_from_ip") @@ -370,7 +370,7 @@ class TestProductRecommendationsView(APITestCase): def setUp(self): super().setUp() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory(password=self.TEST_PASSWORD) self.client.login(username=self.user.username, password=self.TEST_PASSWORD) self.associated_course_keys = ["edx+HL1", "edx+HL2"] diff --git a/lms/djangoapps/mobile_api/testutils.py b/lms/djangoapps/mobile_api/testutils.py index 9c60cdabcc..abd4e0a4e0 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 = 'password' + self.password = 'Password1234' self.username = self.user.username self.api_version = API_V1 IgnoreMobileAvailableFlagConfig(enabled=False).save() diff --git a/lms/djangoapps/survey/tests/test_models.py b/lms/djangoapps/survey/tests/test_models.py index 0ca820652a..e8c6619da6 100644 --- a/lms/djangoapps/survey/tests/test_models.py +++ b/lms/djangoapps/survey/tests/test_models.py @@ -30,7 +30,7 @@ class SurveyModelsTests(TestCase): self.client = Client() # Create two accounts - self.password = 'password' + self.password = 'Password1234' self.student = UserFactory.create( username='student', email='student@test.com', password=self.password, ) diff --git a/lms/djangoapps/survey/tests/test_utils.py b/lms/djangoapps/survey/tests/test_utils.py index 2bb300ea0f..5a940a8901 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 = 'password' + self.password = 'Password1234' 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 83b74b3c5e..9f537de465 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 = 'password' + self.password = 'Password1234' 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 9e81b9e837..c537ff6fc2 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -122,8 +122,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="password") - self.client.login(username="rusty", password="password") + UserFactory.create(username="rusty", password='Password1234') + self.client.login(username="rusty", password='Password1234') def must_be_logged_in(self): self.assertHttpForbidden(self.client.get(self.start_url())) # lint-amnesty, pylint: disable=no-member @@ -1055,11 +1055,11 @@ class CheckoutTestMixin: """ Create a user and course. """ super().setUp() - self.user = UserFactory.create(username="test", password="password") + self.user = UserFactory.create(username="test", password='Password1234') 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="password") + self.client.login(username="test", password='Password1234') def _assert_checked_out( self, @@ -1868,7 +1868,7 @@ class TestPhotoURLView(TestVerificationBase): super().setUp() self.user = AdminFactory() - login_success = self.client.login(username=self.user.username, password='password') + login_success = self.client.login(username=self.user.username, password='Password1234') assert login_success self.attempt = SoftwareSecurePhotoVerification( status="submitted", @@ -1895,7 +1895,7 @@ class TestPhotoURLView(TestVerificationBase): def test_403_for_non_staff(self): self.user = UserFactory() - login_success = self.client.login(username=self.user.username, password='password') + login_success = self.client.login(username=self.user.username, password='Password1234') assert login_success url = reverse('verification_photo_urls', kwargs={'receipt_id': str(self.receipt_id)}) response = self.client.get(url) @@ -1934,7 +1934,7 @@ class TestDecodeImageViews(MockS3Boto3Mixin, TestVerificationBase): def setUp(self): super().setUp() self.user = AdminFactory() - login_success = self.client.login(username=self.user.username, password='password') + login_success = self.client.login(username=self.user.username, password='Password1234') assert login_success def _mock_submit_images(self): @@ -1995,7 +1995,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='password') + login_success = self.client.login(username=self.user.username, password='Password1234') assert login_success self._mock_submit_images() diff --git a/openedx/core/djangoapps/notifications/tests/test_views.py b/openedx/core/djangoapps/notifications/tests/test_views.py index d9af85bd55..b9d62fc064 100644 --- a/openedx/core/djangoapps/notifications/tests/test_views.py +++ b/openedx/core/djangoapps/notifications/tests/test_views.py @@ -319,7 +319,7 @@ class NotificationListAPIViewTest(APITestCase): """ def setUp(self): - self.TEST_PASSWORD = "password" + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory(password=self.TEST_PASSWORD) self.url = reverse('notifications-list') @@ -569,7 +569,7 @@ class MarkNotificationsSeenAPIViewTestCase(APITestCase): """ def setUp(self): - self.TEST_PASSWORD = "password" + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory(password=self.TEST_PASSWORD) # Create some sample notifications for the user @@ -602,7 +602,7 @@ class NotificationReadAPIViewTestCase(APITestCase): """ def setUp(self): - self.TEST_PASSWORD = "password" + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory(password=self.TEST_PASSWORD) self.url = reverse('notifications-read') self.client.login(username=self.user.username, password=self.TEST_PASSWORD) diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py index 5499174747..dc38b18c6e 100644 --- a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py +++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py @@ -31,7 +31,7 @@ class AuthenticateTestCase(TestCase): def setUp(self): super().setUp() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory.create( username='darkhelmet', password=self.TEST_PASSWORD, @@ -57,7 +57,7 @@ class CustomValidationTestCase(TestCase): """ def setUp(self): super().setUp() - self.TEST_PASSWORD = "password" + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory.create( username='darkhelmet', password=self.TEST_PASSWORD, @@ -89,7 +89,7 @@ class CustomAuthorizationViewTestCase(TestCase): """ def setUp(self): super().setUp() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' self.dot_adapter = adapters.DOTAdapter() self.user = UserFactory(password=self.TEST_PASSWORD) self.client.login(username=self.user.username, password=self.TEST_PASSWORD) diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py index 276e4b7825..3ed4c2aca5 100644 --- a/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py +++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py @@ -86,7 +86,7 @@ class _DispatchingViewTestCase(TestCase): """ def setUp(self): super().setUp() - self.TEST_PASSWORD = "password" + self.TEST_PASSWORD = 'Password1234' self.dot_adapter = adapters.DOTAdapter() self.user = UserFactory(password=self.TEST_PASSWORD) self.dot_app = self.dot_adapter.create_public_client( diff --git a/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py b/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py index 0724f5ad01..8063070ea0 100644 --- a/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py +++ b/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py @@ -36,7 +36,7 @@ class TestSafeSessionProcessRequest(TestSafeSessionsLogMixin, TestCase): self.user = UserFactory.create() self.addCleanup(set_current_request, None) self.request = get_mock_request() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' def assert_response(self, safe_cookie_data=None, success=True): """ @@ -251,7 +251,7 @@ class TestSafeSessionMiddleware(TestSafeSessionsLogMixin, CacheIsolationTestCase def setUp(self): super().setUp() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory.create(password=self.TEST_PASSWORD) self.addCleanup(set_current_request, None) self.request = get_mock_request() diff --git a/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py b/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py index bc38553c98..d7578f25eb 100644 --- a/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py +++ b/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py @@ -24,7 +24,7 @@ class TestComprehensiveThemeLMS(TestCase): Clear static file finders cache and register cleanup methods. """ super().setUp() - self.TEST_PASSWORD = 'password' + self.TEST_PASSWORD = 'Password1234' self.user = UserFactory(password=self.TEST_PASSWORD) # Clear the internal staticfiles caches, to get test isolation. diff --git a/openedx/core/djangoapps/theming/tests/test_views.py b/openedx/core/djangoapps/theming/tests/test_views.py index 8ea0d1d5bb..5b5503702c 100644 --- a/openedx/core/djangoapps/theming/tests/test_views.py +++ b/openedx/core/djangoapps/theming/tests/test_views.py @@ -13,7 +13,7 @@ from openedx.core.djangoapps.theming.models import SiteTheme THEMING_ADMIN_URL = '/theming/admin' TEST_THEME_NAME = 'test-theme' -TEST_PASSWORD = 'password' +TEST_PASSWORD = 'Password1234' class TestThemingViews(TestCase): diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_api.py b/openedx/core/djangoapps/user_api/accounts/tests/test_api.py index f7af42dd6b..b856f3fc84 100644 --- a/openedx/core/djangoapps/user_api/accounts/tests/test_api.py +++ b/openedx/core/djangoapps/user_api/accounts/tests/test_api.py @@ -88,7 +88,7 @@ class TestAccountApi(UserSettingsEventTestMixin, EmailTemplateTagMixin, CreateAc This includes the specific types of error raised, and default behavior when optional arguments are not specified. """ - password = "password" + password = 'Password1234' def setUp(self): super().setUp() diff --git a/openedx/core/djangoapps/user_api/tests/test_views.py b/openedx/core/djangoapps/user_api/tests/test_views.py index f8d272df77..28b4c57505 100644 --- a/openedx/core/djangoapps/user_api/tests/test_views.py +++ b/openedx/core/djangoapps/user_api/tests/test_views.py @@ -33,7 +33,7 @@ class UserAPITestCase(ApiTestCase): Parent test case for User API workflow coverage """ LIST_URI = USER_LIST_URI - TEST_PASSWORD = "password" + TEST_PASSWORD = 'Password1234' def get_uri_for_user(self, target_user): """Given a user object, get the URI for the corresponding resource""" diff --git a/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py b/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py index 46b3d65678..c585936e21 100644 --- a/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py +++ b/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py @@ -23,7 +23,7 @@ class VerificationViewTestsMixinBase: """ Base class for the tests on verification views """ VIEW_NAME = None CREATED_AT = datetime.datetime.strptime(FROZEN_TIME, '%Y-%m-%d') - PASSWORD = 'password' + PASSWORD = 'Password1234' def setUp(self): freezer = freezegun.freeze_time(FROZEN_TIME) diff --git a/openedx/core/djangoapps/user_authn/tests/utils.py b/openedx/core/djangoapps/user_authn/tests/utils.py index 1ec522e430..09ca85145f 100644 --- a/openedx/core/djangoapps/user_authn/tests/utils.py +++ b/openedx/core/djangoapps/user_authn/tests/utils.py @@ -58,7 +58,7 @@ class AuthAndScopesTestMixin: self.student. """ default_scopes = None - user_password = 'password' + user_password = 'Password1234' def setUp(self): super().setUp() diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_password.py b/openedx/core/djangoapps/user_authn/views/tests/test_password.py index 408a04d0c1..a403298a6e 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_password.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_password.py @@ -192,11 +192,11 @@ class TestPasswordChange(CreateAccountMixin, CacheIsolationTestCase): UserFactory.create( username='edx', email='edx@example.com', - password='password', + password='Password1234', is_superuser=is_superuser, is_staff=is_staff, ) - self.client.login(username='edx', password='password') + self.client.login(username='edx', password='Password1234') response = self._change_password_from_support(email_from_support_tools=self.OLD_EMAIL) assert response.status_code == 200 diff --git a/openedx/features/course_experience/tests/views/test_course_sock.py b/openedx/features/course_experience/tests/views/test_course_sock.py index 5985850f34..5c612e3ca8 100644 --- a/openedx/features/course_experience/tests/views/test_course_sock.py +++ b/openedx/features/course_experience/tests/views/test_course_sock.py @@ -20,7 +20,7 @@ from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, p from .helpers import add_course_mode -TEST_PASSWORD = 'password' +TEST_PASSWORD = 'Password1234' TEST_VERIFICATION_SOCK_LOCATOR = '