Commit 8751790
committed
Scope test_superuser_sees_all_queryset to test-created corpuses
Two VisibleToUserTests.test_superuser_sees_all_queryset cases (in
test_visibility_managers.py and test_resolvers.py) asserted a personal-
corpus count of 4 (public + private + 2 personal) for the superuser, but
the test DB has a pre-existing "My Documents" corpus owned by
guardian's AnonymousUser (creator_id=1) created during fixture setup,
making the actual count 5.
Filter the assertion's queryset to corpuses created by the two test
users so it is resilient to any fixture-level corpuses that exist at
test DB init time. The unfiltered queryset is still used for the
order_by check.
Closes #13941 parent f40e91f commit 8751790
3 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | | - | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | | - | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
0 commit comments