mirror of https://github.com/zulip/zulip.git
tests: Update tests to use example profile picture.
So that we can stop using Tim's photo for tests, adds an open license profile picture to use instead. Updates tests that used `tim.png` to use the new example profile picture, which is located in `static/images/test-images/avatars/`.
This commit is contained in:
parent
1eda42f509
commit
0c947985bd
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
|
@ -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 = {}
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue