Closed edmorley closed 8 years ago
So the issue above was fixed by tomchristie/django-rest-framework#3785, which is in django-rest-framework 3.3.3+.
However running the tests still fails with exceptions like:
ERROR: tests/test_authentication.py
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/Ed/.virtualenvs/hawkrest/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/home/Ed/.virtualenvs/hawkrest/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/Ed/.virtualenvs/hawkrest/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/Ed/src/hawkrest/tests/test_authentication.py", line 5, in <module>
from django.contrib.auth.models import AbstractBaseUser
File "/home/Ed/.virtualenvs/hawkrest/lib/python2.7/site-packages/django/contrib/auth/models.py", line 6, in <module>
from django.contrib.contenttypes.models import ContentType
File "/home/Ed/.virtualenvs/hawkrest/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 161, in <module>
class ContentType(models.Model):
File "/home/Ed/.virtualenvs/hawkrest/lib/python2.7/site-packages/django/db/models/base.py", line 102, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
And then after adding django.contrib.contenttypes
to INSTALLED_APPS
:
...
RuntimeError: Model class django.contrib.auth.models.Permission doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
And then after also adding django.contrib.auth
to INSTALLED_APPS
:
FAIL: tests/test_authentication.py:TestHawkAuthenticatedUser.test_method_compliance
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/Ed/src/hawkrest/tests/test_authentication.py", line 208, in test_method_compliance
.format(name))
AssertionError: HawkAuthenticatedUser is missing method: save
20 will shortly add Django 1.9 to the Travis run, but marked as allowed to fail, since the tests are currently failing, eg:
https://travis-ci.org/kumar303/hawkrest/jobs/101117531
This appears to be due to Django 1.9 now not allowing models to be imported in
__init__.py
, per: https://docs.djangoproject.com/en/1.7/internals/deprecation/#deprecation-removed-in-1-9However due to a bug, the deprecation warning for this wasn't shown when using previous versions of Django, otherwise the failure mode would have been more clear: https://code.djangoproject.com/ticket/25477
Whilst hawkrest doesn't have any models itself, it imports several rest_framework classes which do import some of the rest_framework's models.
Once support for Django 1.9 is added, the
allow_failure
lines in.travis.yml
can be removed.