Opened 14 years ago

Last modified 14 years ago

#15019 closed

register_models is registering models from apps that are not installed — at Initial Version

Reported by: yashh Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I am not using django's built in auth models. Instead I wrote a auth app with a user model of my choice. I wrote my own Authentication middleware and it works fine. However when I run django test suite, django is registering models Permission, Message, Group from django.contrib.auth even though "django.contrib.auth" is not mentioned in INSTALLED_APPS. Here is a indetail trace of the test suite

/Users/yashh/Desktop/costell/manage.py(11)<module>()

-> execute_manager(settings)

/Library/Python/2.6/site-packages/django/core/management/init.py(438)execute_manager()

-> utility.execute()

/Library/Python/2.6/site-packages/django/core/management/init.py(379)execute()

-> self.fetch_command(subcommand).run_from_argv(self.argv)

/Library/Python/2.6/site-packages/django/core/management/base.py(191)run_from_argv()

-> self.execute(*args, options.dict)

/Library/Python/2.6/site-packages/django/core/management/base.py(220)execute()

-> output = self.handle(*args, options)

/Library/Python/2.6/site-packages/south/management/commands/test.py(8)handle()

-> super(Command, self).handle(*args, kwargs)

/Library/Python/2.6/site-packages/django/core/management/commands/test.py(37)handle()

-> failures = test_runner.run_tests(test_labels)

/Library/Python/2.6/site-packages/django/test/simple.py(314)run_tests()

-> result = self.run_suite(suite)

/Library/Python/2.6/site-packages/django/test/simple.py(274)run_suite()

-> return DjangoTestRunner(verbosity=self.verbosity, failfast=self.failfast).run(suite)

/Library/Python/2.6/site-packages/django/test/simple.py(31)run()

-> result = super(DjangoTestRunner, self).run(*args, kwargs)

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py(753)run()

-> test(result)

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py(464)call()

-> return self.run(*args, kwds)

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py(460)run()

-> test(result)

/Library/Python/2.6/site-packages/django/test/testcases.py(263)call()

-> super(TransactionTestCase, self).call(result)

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py(300)call()

-> return self.run(*args, kwds)

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py(279)run()

-> testMethod()

/Users/yashh/Desktop/costell/cork/tests.py(17)test_login()

-> response = self.client.get('/login/')

/Library/Python/2.6/site-packages/django/test/client.py(298)get()

-> response = self.request(r)

/Library/Python/2.6/site-packages/django/test/client.py(238)request()

-> response = self.handler(environ)

/Library/Python/2.6/site-packages/django/test/client.py(79)call()

-> response = self.get_response(request)

/Library/Python/2.6/site-packages/django/core/handlers/base.py(91)get_response()

-> request.path_info)

/Library/Python/2.6/site-packages/django/core/urlresolvers.py(215)resolve()

-> for pattern in self.url_patterns:

/Library/Python/2.6/site-packages/django/core/urlresolvers.py(244)_get_url_patterns()

-> patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

/Library/Python/2.6/site-packages/django/core/urlresolvers.py(239)_get_urlconf_module()

-> self._urlconf_module = import_module(self.urlconf_name)

/Library/Python/2.6/site-packages/django/utils/importlib.py(35)import_module()

-> import(name)

/Users/yashh/Desktop/costell/urls.py(3)<module>()

-> from django.contrib.auth import views as auth_views

/Library/Python/2.6/site-packages/django/contrib/auth/views.py(7)<module>()

-> from django.contrib.auth.forms import AuthenticationForm

/Library/Python/2.6/site-packages/django/contrib/auth/forms.py(1)<module>()

-> from django.contrib.auth.models import User

/Library/Python/2.6/site-packages/django/contrib/auth/models.py(53)<module>()

-> class Permission(models.Model):

/Library/Python/2.6/site-packages/django/db/models/base.py(193)new()

-> register_models(new_class._meta.app_label, new_class)

/Library/Python/2.6/site-packages/django/db/models/loading.py(197)register_models()

The traceback ends when Permission model is passed to register_models

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top