mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Complete tests and remove duplicate context information
This commit is contained in:
2 files changed
+6
-4
No files matched your search
@@ -20,7 +20,6 @@ Test module for Plinth's custom context processors.
|
||||
"""
|
||||
from unittest.mock import Mock
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.http import HttpRequest
|
||||
from django.test import TestCase
|
||||
|
||||
@@ -55,6 +54,11 @@ class ContextProcessorsTestCase(TestCase):
|
||||
self.assertIsNotNone(urls)
|
||||
self.assertEqual(['/', '/aaa/', '/aaa/bbb/', '/aaa/bbb/ccc/'], urls)
|
||||
|
||||
self.assertTrue(response['user_is_admin'])
|
||||
request.user.groups.filter().exists = Mock(return_value=False)
|
||||
response = cp.common(request)
|
||||
self.assertFalse(response['user_is_admin'])
|
||||
|
||||
def test_common_border_conditions(self):
|
||||
"""Verify that the common() function works for border conditions."""
|
||||
request = HttpRequest()
|
||||
|
||||
Reference in new issue
Block a user