Permalink
Browse files

Fixed test cases.

  • Loading branch information...
1 parent dad28e1 commit 2cb34b94df25c4663db80fc4bc24ae0d8558aa15 @bartTC committed Sep 8, 2009
Showing with 11 additions and 4 deletions.
  1. +11 −4 django_generic_flatblocks/tests/__init__.py
@@ -13,7 +13,14 @@ def setUp(self):
dummy_user.first_name = u'John'
dummy_user.last_naem = u'Doe'
dummy_user.save()
+
+ self.assertEqual(dummy_user.pk, 1)
+
self.dummy_user = dummy_user
+
+ def tearDown(self):
+ from django.contrib.auth.models import User
+ User.objects.all().delete()
def parseTemplate(self, template_string):
t = Template(template_string)
@@ -170,15 +177,15 @@ def testIntoArgument(self):
self.assertTrue(u'<foo></foo>' in t)
- from django.core.exceptions import ObjectDoesNotExist
- settings.DEBUG = True
+ from django.contrib.auth.models import User
+ settings.TEMPLATE_DEBUG = True
template_string = '''
{% load generic_flatblocks %}
{% gblock 5 for "auth.User" into "the_user" %}
<foo>{{ the_user.username }}</foo>
'''
- self.assertRaises(ObjectDoesNotExist, self.parseTemplate, template_string)
- settings.DEBUG = False
+ self.assertRaises((User.DoesNotExist, TemplateSyntaxError), self.parseTemplate, template_string)
+ settings.TEMPLATE_DEBUG = False
def testRelatedObjectDeletion(self):
template_string = '''

0 comments on commit 2cb34b9

Please sign in to comment.