Commit 9b445f268529592d4c2b9b0371218309f90edc0b

Authored by Claude Paroz
1 parent a1c1e83d

Replaced test urls by ROOT_URLCONF override

... ... @@ -16,13 +16,15 @@ from testapp.models import Article, Author
16 16 CT = ContentType.objects.get_for_model
17 17
18 18
19   -@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',))
  19 +@override_settings(
  20 + PASSWORD_HASHERS=('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',),
  21 + ROOT_URLCONF='testapp.urls_default',
  22 +)
20 23 class CommentTestCase(TestCase):
21 24 """
22 25 Helper base class for comment tests that need data.
23 26 """
24 27 fixtures = ["comment_tests"]
25   - urls = 'testapp.urls_default'
26 28
27 29 def createSomeComments(self):
28 30 # Two anonymous comments on two different objects
... ...
... ... @@ -50,10 +50,9 @@ class CommentAppAPITests(CommentTestCase):
50 50
51 51
52 52 @override_settings(
53   - COMMENTS_APP='custom_comments',
  53 + COMMENTS_APP='custom_comments', ROOT_URLCONF='testapp.urls',
54 54 )
55 55 class CustomCommentTest(CommentTestCase):
56   - urls = 'testapp.urls'
57 56
58 57 def testGetCommentApp(self):
59 58 import custom_comments
... ...
... ... @@ -5,6 +5,7 @@ from xml.etree import ElementTree as ET
5 5 from django.conf import settings
6 6 from django.contrib.contenttypes.models import ContentType
7 7 from django.contrib.sites.models import Site
  8 +from django.test.utils import override_settings
8 9
9 10 from django_comments.models import Comment
10 11
... ... @@ -12,8 +13,8 @@ from . import CommentTestCase
12 13 from testapp.models import Article
13 14
14 15
  16 +@override_settings(ROOT_URLCONF='testapp.urls')
15 17 class CommentFeedTests(CommentTestCase):
16   - urls = 'testapp.urls'
17 18 feed_url = '/rss/comments/'
18 19
19 20 def setUp(self):
... ...
... ... @@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
2 2
3 3 from django.contrib.auth.models import User, Permission
4 4 from django.contrib.contenttypes.models import ContentType
  5 +from django.test.utils import override_settings
5 6 from django.utils import translation
6 7
7 8 from django_comments import signals
... ... @@ -259,8 +260,8 @@ class ApproveViewTests(CommentTestCase):
259 260 self.assertTemplateUsed(response, "comments/approved.html")
260 261
261 262
  263 +@override_settings(ROOT_URLCONF='testapp.urls_admin')
262 264 class AdminActionsTests(CommentTestCase):
263   - urls = "testapp.urls_admin"
264 265
265 266 def setUp(self):
266 267 super(AdminActionsTests, self).setUp()
... ...
Please register or login to post a comment