diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-10 16:56:42 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-10 16:56:42 +0200 |
| commit | a4dec43b520fa51bf7a949576b5767242c74c982 (patch) | |
| tree | fab7ab693f1570e93ffc870839bb941b440d04a9 | |
| parent | bdd285723f9b0044eca690634c412c1c3eec76c0 (diff) | |
Fixed two admin_views tests under Oracle.
Thanks Anssi for the review.
| -rw-r--r-- | tests/admin_views/tests.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index e0000ff6b5..39c0eb1088 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -26,6 +26,7 @@ from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.models import Group, User, Permission, UNUSABLE_PASSWORD from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse +from django.db import connection from django.forms.util import ErrorList from django.template.response import TemplateResponse from django.test import TestCase @@ -3605,7 +3606,13 @@ class UserAdminTest(TestCase): # Don't depend on a warm cache, see #17377. ContentType.objects.clear_cache() - with self.assertNumQueries(10): + + expected_queries = 10 + # Oracle doesn't implement "RELEASE SAVPOINT", see #20387. + if connection.vendor == 'oracle': + expected_queries -= 1 + + with self.assertNumQueries(9): response = self.client.get('/test_admin/admin/auth/user/%s/' % u.pk) self.assertEqual(response.status_code, 200) @@ -3643,7 +3650,12 @@ class GroupAdminTest(TestCase): def test_group_permission_performance(self): g = Group.objects.create(name="test_group") - with self.assertNumQueries(8): # instead of 259! + expected_queries = 8 + # Oracle doesn't implement "RELEASE SAVPOINT", see #20387. + if connection.vendor == 'oracle': + expected_queries -= 1 + + with self.assertNumQueries(expected_queries): response = self.client.get('/test_admin/admin/auth/group/%s/' % g.pk) self.assertEqual(response.status_code, 200) |
