change user_name still used as login and add display_name for dashboard view instead of username on login

This commit is contained in:
Alberto-Audrix committed 2026-09-10 10:51:51 +07:00
1 parent 7a562c18ec
commit 11b0ca26a5
33 files changed
+180 -145

No files matched your search

+6 -6
View File
@@ -10,19 +10,19 @@ class VisibilityScopeTests(TestCase):
def setUp(self):
self.client = APIClient()
self.director = User.objects.create_user(
user_login="dir1", password="x", status=User.STATUS_DIRECTOR
user_name="dir1", password="x", status=User.STATUS_DIRECTOR
)
self.buh = User.objects.create_user(
user_login="buh1", password="x", status=User.STATUS_BUH
user_name="buh1", password="x", status=User.STATUS_BUH
)
self.buh_other = User.objects.create_user(
user_login="buh2", password="x", status=User.STATUS_BUH
user_name="buh2", password="x", status=User.STATUS_BUH
)
self.gm = User.objects.create_user(
user_login="gm1", password="x", status=User.STATUS_GM, managed_by=self.buh
user_name="gm1", password="x", status=User.STATUS_GM, managed_by=self.buh
)
self.gm_other = User.objects.create_user(
user_login="gm2",
user_name="gm2",
password="x",
status=User.STATUS_GM,
managed_by=self.buh_other,
@@ -67,7 +67,7 @@ class VisibilityScopeTests(TestCase):
self.client.force_authenticate(self.buh)
response = self.client.get("/api/v1/users/")
self.assertEqual(response.status_code, 200)
names = {row["user_name"] for row in response.data["results"]}
names = {row["display_name"] for row in response.data["results"]}
self.assertEqual(names, {"gm1"})
def test_gm_sees_own_city_sites_only(self):