diff --git a/tests/regressiontests/test_utils/tests_25.py b/tests/regressiontests/test_utils/tests_25.py
index 4adea6c..05ed317 100644
a
|
b
|
class AssertNumQueriesTests(TestCase):
|
26 | 26 | with self.assertRaises(TypeError): |
27 | 27 | with self.assertNumQueries(4000): |
28 | 28 | raise TypeError |
| 29 | |
| 30 | def test_with_client(self): |
| 31 | person = Person.objects.create(name='test') |
| 32 | |
| 33 | with self.assertNumQueries(1): |
| 34 | self.client.get('/test_utils/get_person/%s/' % person.pk) |
| 35 | |
| 36 | with self.assertNumQueries(1): |
| 37 | self.client.get('/test_utils/get_person/%s/' % person.pk) |
diff --git a/tests/regressiontests/test_utils/urls.py b/tests/regressiontests/test_utils/urls.py
new file mode 100644
index 0000000..1109b82
-
|
+
|
|
| 1 | from django.conf.urls.defaults import * |
| 2 | import views |
| 3 | |
| 4 | urlpatterns = patterns('', |
| 5 | (r'^get_person/(\d+)/$', views.get_person), |
| 6 | ) |
| 7 | No newline at end of file |
diff --git a/tests/regressiontests/test_utils/views.py b/tests/regressiontests/test_utils/views.py
new file mode 100644
index 0000000..62af0d9
-
|
+
|
|
| 1 | from django.http import HttpResponse |
| 2 | from django.shortcuts import get_object_or_404 |
| 3 | from models import Person |
| 4 | |
| 5 | def get_person(request, pk): |
| 6 | person = get_object_or_404(Person, pk=pk) |
| 7 | return HttpResponse(person.name) |
| 8 | No newline at end of file |
diff --git a/tests/urls.py b/tests/urls.py
index 01d6408..5fd4e7d 100644
a
|
b
|
urlpatterns = patterns('',
|
41 | 41 | |
42 | 42 | # special headers views |
43 | 43 | (r'special_headers/', include('regressiontests.special_headers.urls')), |
| 44 | |
| 45 | # test util views |
| 46 | (r'test_utils/', include('regressiontests.test_utils.urls')), |
44 | 47 | ) |