Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed two admin_views tests under Oracle.

Thanks Anssi for the review.
  • Loading branch information...
commit a4dec43b520fa51bf7a949576b5767242c74c982 1 parent bdd2857
@aaugustin aaugustin authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 tests/admin_views/tests.py
View
16 tests/admin_views/tests.py
@@ -26,6 +26,7 @@
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 @@ def test_user_permission_performance(self):
# 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 @@ def test_save_button(self):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.