diff --git a/categories/__init__.py b/categories/__init__.py index eae85e8..cc97aec 100644 --- a/categories/__init__.py +++ b/categories/__init__.py @@ -21,16 +21,3 @@ __version__ = get_version() default_app_config = 'categories.apps.CategoriesConfig' - - -def register(): - from categories import settings - from categories.registration import (_process_registry, registry) - _process_registry(settings.FK_REGISTRY, registry.register_fk) - _process_registry(settings.M2M_REGISTRY, registry.register_m2m) - - -try: - register() -except Exception as e: - print(e) diff --git a/categories/tests/test_mgmt_commands.py b/categories/tests/test_mgmt_commands.py index 78c1b28..96ba5a7 100644 --- a/categories/tests/test_mgmt_commands.py +++ b/categories/tests/test_mgmt_commands.py @@ -3,11 +3,22 @@ from unittest import skip from django.core import management from django.core.management.base import CommandError +from django.db import connection from django.test import TestCase class TestMgmtCommands(TestCase): + @classmethod + def setUpClass(cls): + connection.disable_constraint_checking() + super(TestMgmtCommands, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestMgmtCommands, cls).tearDownClass() + connection.enable_constraint_checking() + def test_add_category_fields(self): management.call_command('add_category_fields', verbosity=0)