Deregister ephimeral models from ModelPermissions
Explictly delete the ephimeral models from ModelPermission registry to avoid them being lookedup in a subsequent tests where they don't exist. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -12,6 +12,12 @@ class ModelPermission(object):
|
||||
_inheritances = {}
|
||||
_registry = {}
|
||||
|
||||
@classmethod
|
||||
def deregister(cls, model):
|
||||
cls._registry.pop(model, None)
|
||||
# TODO: Find method to revert the add_to_class('acls'...)
|
||||
# delattr doesn't work.
|
||||
|
||||
@classmethod
|
||||
def register(cls, model, permissions):
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
|
||||
Reference in New Issue
Block a user