4👍
I figured this out:
I should have treatead Permission
as a regular Django model.
from django.test import TestCase
from django.contrib.auth.models import Permission
class TestPermission(TestCase):
def test_existence_of_permission(self):
self.assertFalse(Permission.objects.filter(
codename='a_non_existant_permission').exists())
👤HBat
Source:stackexchange.com