#17377: Test admin_views.UserAdminTest.test_user_permission_performance depends 
on
side effects
--------------------------------+-----------------------------
     Reporter:  gregmuellegger  |      Owner:  nobody
         Type:  Bug             |     Status:  new
    Component:  Uncategorized   |    Version:  SVN
     Severity:  Normal          |   Keywords:  test sideeffect
 Triage Stage:  Unreviewed      |  Has patch:  0
Easy pickings:  0               |      UI/UX:  0
--------------------------------+-----------------------------
 The test {{{admin_views.UserAdminTest.test_user_permission_performance}}}
 fails if it's run on its own. If run in conjunction with other tests, it
 gets a cache hit for looking up a content type. When run on it's own it
 needs to look that up, causing more queries than expected.

 {{{
 gregor@layka ~/projects/gsoc/django/tests (git)-[master] % PYTHONPATH=..
 ./runtests.py --settings=test_sqlite
 admin_views.UserAdminTest.test_user_permission_performance
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 F
 ======================================================================
 FAIL: test_user_permission_performance
 (regressiontests.admin_views.tests.UserAdminTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/home/gregor/projects/gsoc/django/tests/regressiontests/admin_views/tests.py",
 line 2987, in test_user_permission_performance
     self.assertEqual(response.status_code, 200)
   File "/home/gregor/projects/gsoc/django/django/test/testcases.py", line
 246, in __exit__
     executed, self.num
 AssertionError: 8 queries executed, 7 expected

 ----------------------------------------------------------------------
 Ran 1 test in 0.237s

 FAILED (failures=1)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 1 gregor@layka ~/projects/gsoc/django/tests (git)-[master] % PYTHONPATH=..
 ./runtests.py --settings=test_sqlite admin_views.UserAdminTest
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 ......
 ----------------------------------------------------------------------
 Ran 6 tests in 0.718s

 OK
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 gregor@layka ~/projects/gsoc/django/tests (git)-[master] % PYTHONPATH=..
 ./runtests.py --settings=test_sqlite
 admin_views.UserAdminTest.test_user_permission_performance
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 F
 ======================================================================
 FAIL: test_user_permission_performance
 (regressiontests.admin_views.tests.UserAdminTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/home/gregor/projects/gsoc/django/tests/regressiontests/admin_views/tests.py",
 line 2987, in test_user_permission_performance
     self.assertEqual(response.status_code, 200)
   File "/home/gregor/projects/gsoc/django/django/test/testcases.py", line
 246, in __exit__
     executed, self.num
 AssertionError: 8 queries executed, 7 expected

 ----------------------------------------------------------------------
 Ran 1 test in 0.228s

 FAILED (failures=1)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17377>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to