diff --git a/static/images/test-images/avatars/example_profile_picture.png b/static/images/test-images/avatars/example_profile_picture.png new file mode 100644 index 0000000000..fc2ef1159a Binary files /dev/null and b/static/images/test-images/avatars/example_profile_picture.png differ diff --git a/zerver/lib/dev_ldap_directory.py b/zerver/lib/dev_ldap_directory.py index 8233a44cfa..108d4a64e7 100644 --- a/zerver/lib/dev_ldap_directory.py +++ b/zerver/lib/dev_ldap_directory.py @@ -25,7 +25,7 @@ def generate_dev_ldap_dir(mode: str, num_users: int = 8) -> Dict[str, Dict[str, ldap_data.append((name, email, phone_number, birthdate)) profile_images = [] - for path in glob.glob(os.path.join(static_path("images/landing-page/team"), "*")): + for path in glob.glob(os.path.join(static_path("images/test-images/avatars"), "*")): with open(path, "rb") as f: profile_images.append(f.read()) ldap_dir = {} diff --git a/zerver/tests/fixtures/ldap/directory.json b/zerver/tests/fixtures/ldap/directory.json index 1cc0767bf8..fba4d58846 100644 --- a/zerver/tests/fixtures/ldap/directory.json +++ b/zerver/tests/fixtures/ldap/directory.json @@ -13,7 +13,7 @@ "sn": ["Hamlet"], "homePhone": ["123456789"], "birthDate": ["1900-09-08"], - "jpegPhoto": "file:static/images/landing-page/team/tim.png" + "jpegPhoto": "file:static/images/test-images/avatars/example_profile_picture.png" }, "uid=cordelia,ou=users,dc=zulip,dc=com": { @@ -38,7 +38,7 @@ "uid": ["newuser"], "sn": ["shortname"], "homePhone": ["a-new-number"], - "jpegPhoto": "file:static/images/landing-page/team/tim.png" + "jpegPhoto": "file:static/images/test-images/avatars/example_profile_picture.png" }, "uid=newuser_splitname,ou=users,dc=zulip,dc=com": { diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py index 34aa2a8f87..ca475b4bc0 100644 --- a/zerver/tests/test_auth_backends.py +++ b/zerver/tests/test_auth_backends.py @@ -6053,10 +6053,16 @@ class TestLDAP(ZulipLDAPTestCase): response = self.client_get(url) self.assertEqual(response.status_code, 200) with open( - os.path.join(settings.DEPLOY_ROOT, "static/images/landing-page/team/tim.png"), "rb" + os.path.join( + settings.DEPLOY_ROOT, + "static/images/test-images/avatars/example_profile_picture.png", + ), + "rb", ) as f: - tim = f.read() - self.assert_streaming_content(response, resize_avatar(tim, DEFAULT_AVATAR_SIZE)) + example_avatar = f.read() + self.assert_streaming_content( + response, resize_avatar(example_avatar, DEFAULT_AVATAR_SIZE) + ) @override_settings(AUTHENTICATION_BACKENDS=("zproject.backends.ZulipLDAPAuthBackend",)) def test_login_success_when_user_does_not_exist_with_split_full_name_mapping(self) -> None: