fix ValueError in tests

This commit is contained in:
Petr Dlouhý 2020-03-13 20:02:38 +01:00
parent 2c1130c9b8
commit 7d93346352

View file

@ -7,19 +7,15 @@ class CategoryM2MField(ManyToManyField):
"""A many to many field to a Category model."""
def __init__(self, **kwargs):
from .models import Category
if "to" in kwargs:
kwargs.pop("to")
super(CategoryM2MField, self).__init__(to=Category, **kwargs)
super(CategoryM2MField, self).__init__(to="categories.Category", **kwargs)
class CategoryFKField(ForeignKey):
"""A foreign key to the Category model."""
def __init__(self, **kwargs):
from .models import Category
if "to" in kwargs:
kwargs.pop("to")
super(CategoryFKField, self).__init__(to=Category, **kwargs)
super(CategoryFKField, self).__init__(to="categories.Category", **kwargs)