@@ -240,11 +240,14 @@ def test_get_items(req):
240240 "permissions,expected" ,
241241 [
242242 ([], True ),
243+ (["is_anonymous" ], True ),
243244 (["is_authenticated" ], False ),
245+ (["is_active" ], False ),
244246 (["is_staff" ], False ),
245247 (["is_superuser" ], False ),
246248 (["is_authenticated" , "is_staff" ], False ),
247249 (["is_authenticated" , "is_superuser" ], False ),
250+ (["is_anonymous" , "is_authenticated" ], False ),
248251 ],
249252)
250253def test_check_permissions_anonymous (permissions , expected , req ):
@@ -259,7 +262,9 @@ def test_check_permissions_anonymous(permissions, expected, req):
259262 "permissions,expected" ,
260263 [
261264 ([], True ),
265+ (["is_anonymous" ], False ),
262266 (["is_authenticated" ], True ),
267+ (["is_active" ], True ),
263268 (["is_staff" ], False ),
264269 (["is_superuser" ], False ),
265270 (["is_authenticated" , "is_staff" ], False ),
@@ -278,7 +283,9 @@ def test_check_permissions_is_authenticated(permissions, expected, req):
278283 "permissions,expected" ,
279284 [
280285 ([], True ),
286+ (["is_anonymous" ], False ),
281287 (["is_authenticated" ], True ),
288+ (["is_active" ], True ),
282289 (["is_staff" ], True ),
283290 (["is_superuser" ], False ),
284291 (["is_authenticated" , "is_staff" ], True ),
@@ -297,7 +304,9 @@ def test_check_permissions_is_staff(permissions, expected, req):
297304 "permissions,expected" ,
298305 [
299306 ([], True ),
307+ (["is_anonymous" ], True ),
300308 (["is_authenticated" ], True ),
309+ (["is_active" ], True ),
301310 (["is_staff" ], True ),
302311 (["is_superuser" ], True ),
303312 (["is_authenticated" , "is_staff" ], True ),
@@ -316,7 +325,9 @@ def test_check_permissions_is_superuser(permissions, expected, req):
316325 "permissions,expected" ,
317326 [
318327 ([], True ),
328+ (["is_anonymous" ], False ),
319329 (["is_authenticated" ], False ),
330+ (["is_active" ], False ),
320331 (["is_staff" ], False ),
321332 (["is_superuser" ], False ),
322333 (["is_authenticated" , "is_staff" ], False ),
@@ -333,7 +344,9 @@ def test_check_permissions_no_request_user(permissions, expected, req):
333344 "permissions,expected" ,
334345 [
335346 ([], True ),
347+ (["is_anonymous" ], True ),
336348 (["is_authenticated" ], True ),
349+ (["is_active" ], True ),
337350 (["is_staff" ], True ),
338351 (["is_superuser" ], True ),
339352 (["is_authenticated" , "is_staff" ], True ),
@@ -381,7 +394,9 @@ def check_is_authenticated(request):
381394 "permissions,expected" ,
382395 [
383396 ([], True ),
397+ (["is_anonymous" ], False ),
384398 (["is_authenticated" ], True ),
399+ (["is_active" ], True ),
385400 (["is_staff" ], False ),
386401 (["is_superuser" ], False ),
387402 (["is_authenticated" , "is_staff" ], False ),
@@ -414,7 +429,9 @@ def test_check_permissions_auth_permission_is_authenticated(permissions, expecte
414429 "permissions,expected" ,
415430 [
416431 ([], True ),
432+ (["is_anonymous" ], False ),
417433 (["is_authenticated" ], True ),
434+ (["is_active" ], True ),
418435 (["is_staff" ], True ),
419436 (["is_superuser" ], False ),
420437 (["is_authenticated" , "is_staff" ], True ),
@@ -447,7 +464,9 @@ def test_check_permissions_auth_permission_is_staff(permissions, expected, req):
447464 "permissions,expected" ,
448465 [
449466 ([], True ),
467+ (["is_anonymous" ], True ),
450468 (["is_authenticated" ], True ),
469+ (["is_active" ], True ),
451470 (["is_staff" ], True ),
452471 (["is_superuser" ], True ),
453472 (["is_authenticated" , "is_staff" ], True ),
0 commit comments