I Written the Django signals for creating the groups and assign permissions to theses groups for the different user roles but when I am running my test cases then I am getting permission error for creating test database.
signal.py
from django.contrib.auth.models import Permission, Group
def create_group():
permission = Permission.objects.get(codename=codename, contant_type=contant_type)
This is working fine for me when I run my migrations but when I am trying to run my test cases then I ma getting error for creating test database.
django.contrib.auth.models.DoesNotExist: Permission matching query does not exist.