Initial fixtures with the auth Module

49 views
Skip to first unread message

Dennis Hellmich

unread,
Oct 17, 2013, 12:58:44 PM10/17/13
to django...@googlegroups.com
Hi,

since the update to Django 1.5 a problem appears in my test when I try to load the initial data from a fixture into the database.
My guess is that this problem is connected to the mod_wsgi auth handler.

model: auth.Group
    pk: 1
    fields:
        name:  Admins
        permissions:   [
            [ 'add_user', 'auth', 'user' ],
            [ 'change_user', 'auth', 'user' ],
            [ 'delete_user', 'auth', 'user' ],
         ]

When I try to run the tests (and load this fixture) I get the following error message:

ERROR: test_check_password_custom_user (django.contrib.auth.tests.handlers.ModWsgiHandlerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/test/testcases.py", line 268, in __call__
    self._post_teardown()
  File "/usr/local/lib/python2.7/dist-packages/django/test/testcases.py", line 533, in _post_teardown
    self._fixture_teardown()
  File "/usr/local/lib/python2.7/dist-packages/django/test/testcases.py", line 553, in _fixture_teardown
    skip_validation=True, reset_sequences=False)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 161, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 385, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/flush.py", line 89, in handle_noargs
    call_command('loaddata', 'initial_data', **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 161, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 187, in handle
    for obj in objects:
  File "/usr/local/lib/python2.7/dist-packages/django/core/serializers/pyyaml.py", line 67, in Deserializer
    raise DeserializationError(e)
DeserializationError: Problem installing fixture '/home/projects/fixtures/initial_data.yaml': Permission matching query does not exist.

This error does not occur if I don't assign any permissions to the group.
Does anyone have an idea how to solve this problem?

Thanks a lot in advance,
Dennis


P.S.
some addional information:
django.VERSION = (1, 5, 4, 'final', 0)
Python 2.7.3
Reply all
Reply to author
Forward
0 new messages