test_user_acl_context_processor.py 364 B

123456789101112
  1. from unittest.mock import Mock
  2. from django.test import TestCase
  3. from misago.acl.context_processors import user_acl
  4. class ContextProcessorsTests(TestCase):
  5. def test_context_processor_adds_request_user_acl_to_context(self):
  6. test_acl = {"test": True}
  7. context = user_acl(Mock(user_acl=test_acl))
  8. assert context == {"user_acl": test_acl}