Skip to content

Commit

Permalink
Update zds/member/api/tests.py
Browse files Browse the repository at this point in the history
Co-authored-by: Ph. SW. <philippe.milink@gmx.fr>
  • Loading branch information
Situphen and philippemilink authored Sep 22, 2024
1 parent 5b8e956 commit a43a4a1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zds/member/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,17 @@ def test_search_without_results_in_list_of_users(self):
def test_search_with_results_in_right_order(self):
"""
Gets list of users corresponding to part of a username and
verifies that the list of usernames returned is in the right order.
verifies that the list of usernames returned is in the right order, which is:
1. "is equal" case sensitive
2. "is equal" ignoring the case
3. "starts with" case sensitive
4. "starts with" ignoring the case
5. "contains" case sensitive
6. "contains" ignoring the case
The test also checks that:
- pseudos containing letters of the searched word (here: 'a', 'n', 'd' and 'r'), but NOT the searched word ("andr") are not returned
- pseudos containing non-ascii letters (eg with accents) can be returned as well
"""
for username in ("pierre", "andr", "Radon", "alexandre", "MisterAndrew", "andré", "dragon", "Andromède"):
ProfileFactory(user__username=username)
Expand Down

0 comments on commit a43a4a1

Please sign in to comment.