From d1c6ce65ddf820056d5cdec13aa47f3e1247d691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Fri, 13 Mar 2020 20:02:38 +0100 Subject: [PATCH] fix ValueError in tests --- categories/fields.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/categories/fields.py b/categories/fields.py index 12f254e7..47651206 100644 --- a/categories/fields.py +++ b/categories/fields.py @@ -6,19 +6,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)