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

tests fail with Django 1.7 c2 #255

Closed
brianmay opened this issue Aug 19, 2014 · 6 comments
Closed

tests fail with Django 1.7 c2 #255

brianmay opened this issue Aug 19, 2014 · 6 comments

Comments

@brianmay
Copy link
Contributor

$ python setup.py test                                                                                                                                                                                                                                                [14:09:35]
running test
running egg_info
creating django_guardian.egg-info
writing requirements to django_guardian.egg-info/requires.txt
writing django_guardian.egg-info/PKG-INFO
writing top-level names to django_guardian.egg-info/top_level.txt
writing dependency_links to django_guardian.egg-info/dependency_links.txt
writing manifest file 'django_guardian.egg-info/SOURCES.txt'
reading manifest file 'django_guardian.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.json' under directory 'guardian/fixtures'
warning: no files found matching '*.html' under directory 'guardian/tests/templates'
warning: no previously-included files matching '*' found under directory 'docs/build'
writing manifest file 'django_guardian.egg-info/SOURCES.txt'
running build_ext
django-guardian module's path: '/home/brian/tree/debian/unstable/django-guardian/django-guardian-1.2.4/guardian'
=========================================================
Starting tests for db backend: django.db.backends.sqlite3
    ENGINE: "django.db.backends.sqlite3"
    NAME: ":memory:"
    TEST_NAME: ":memory:"
=========================================================
Creating test database for alias 'default'...
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
        HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
        HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
        HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
Traceback (most recent call last):
  File "setup.py", line 54, in <module>
    **extra_kwargs
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 137, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 117, in with_project_on_sys_path
    func()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 146, in run_tests
    testLoader = loader_class()
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 128, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 113, in loadTestsFromName
    test = obj()
  File "/home/brian/tree/debian/unstable/django-guardian/django-guardian-1.2.4/tests.py", line 46, in main
    failures = run_tests(settings)
  File "/home/brian/tree/debian/unstable/django-guardian/django-guardian-1.2.4/tests.py", line 42, in run_tests
    failures = test_runner.run_tests(['auth', 'guardian', 'testapp'])
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 147, in run_tests
    old_config = self.setup_databases()
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 109, in setup_databases
    return setup_databases(self.verbosity, self.interactive, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 299, in setup_databases
    serialize=connection.settings_dict.get("TEST_SERIALIZE", True),
  File "/usr/lib/python2.7/dist-packages/django/db/backends/creation.py", line 374, in create_test_db
    test_flush=True,
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 115, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 337, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 160, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 63, in migrate
    self.apply_migration(migration, fake=fake)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 91, in apply_migration
    if self.detect_soft_applied(migration):
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 135, in detect_soft_applied
    apps = project_state.render()
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/state.py", line 71, in render
    raise InvalidBasesError("Cannot resolve bases for %r\nThis can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)\n in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more" % new_unrendered_models)
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'testapp.LogEntryWithGroup'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more

I am still trying to work this out, however suspect this is because testapp doesn't have migrations.

The fix might be to rename all "migrations" directories to "south_migrations" (supported with no config changes in South 1.0), and create Django 1.7 migrations for all the Django apps.

@brianmay
Copy link
Contributor Author

I have patches that fix this. See https://github.com/brianmay/django-guardian/tree/master/debian/patches patches 0004 to 0010.

You might want to consider the 0002 patch too.

This is for 1.2.4 stable version, it looks the git version has a new NonIntPKModel db model that isn't in my patches.

@rhertzog
Copy link

rhertzog commented Sep 4, 2014

Django 1.7 is now officially released and it would be nice if django-guardian could officially support it! TIA.

@troygrosfield
Copy link
Contributor

Support for django 1.7 and python 3.4 would be great!

@brianmay
Copy link
Contributor Author

Closing this bug report. Fixed in in #357.

@ikebo
Copy link

ikebo commented Jul 18, 2017

hh

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

4 participants