def toggle_all_seeing(request): return_url = request.META["HTTP_REFERER"] if not is_admin_user(request): return HttpResponseRedirect(return_url) toggle_all_seeing_for_user(request.user) return HttpResponseRedirect(return_url)
def toggle_all_seeing(request): return_url = request.META["HTTP_REFERER"] if not is_admin_user(request): return HttpResponseRedirect(return_url) toggle_all_seeing_for_user(request.user) return HttpResponseRedirect(return_url)
def test_is_user_all_seeing(rf, admin_user): assert not is_user_all_seeing(admin_user) toggle_all_seeing_for_user(admin_user) assert is_user_all_seeing(admin_user) toggle_all_seeing_for_user(admin_user) assert not is_user_all_seeing(admin_user)
def test_is_user_all_seeing(rf, admin_user): assert not is_user_all_seeing(admin_user) toggle_all_seeing_for_user(admin_user) assert is_user_all_seeing(admin_user) toggle_all_seeing_for_user(admin_user) assert not is_user_all_seeing(admin_user)