Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django.contrib.auth models import #37

Open
tkhyn opened this issue Apr 14, 2015 · 2 comments
Open

django.contrib.auth models import #37

tkhyn opened this issue Apr 14, 2015 · 2 comments

Comments

@tkhyn
Copy link
Contributor

tkhyn commented Apr 14, 2015

When running the tests for django-gm2m, that uses mock-django, against django 1.8, I have the following warnings:

d:\dev\.env\buildout\eggs\django-1.8-py2.7.egg\django\contrib\auth\models.py:41: RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Permission(models.Model):

d:\dev\.env\buildout\eggs\django-1.8-py2.7.egg\django\contrib\auth\models.py:98: RemovedInDjango19Warning: Model class django.contrib.auth.models.Group doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Group(models.Model):

d:\dev\.env\buildout\eggs\django-1.8-py2.7.egg\django\contrib\auth\models.py:436: RemovedInDjango19Warning: Model class django.contrib.auth.models.User doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class User(AbstractUser)

This comes from the fact that importing mock_django imports mock_django.http which itself imports django.contrib.auth.models ... which triggers the 3 warnings above (they won't be warnings anymore in django 1.9 though, and will break the test suite) as django.contrib.auth is not in INSTALLED_APPS.

The solution I'd think of would be to drop the from .http import * in __init__.py but it may not be suitable for you.

Thanks for looking at that

T

@bennylope
Copy link
Contributor

This is likely resolved with the changes applied from #41.

@tkhyn
Copy link
Contributor Author

tkhyn commented Dec 12, 2015

Thanks @bennylope. Unfortunately it did not resolve that issue. __init__ still imports http, which still imports django.contrib.auth.models causing the warnings to be raised with Django 1.8 and the test suite to fail on Django 1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants