Hello,
I encountered a problem while writing some django tests on the svn
version. Whenever I call reverse(urlname), the db is emptied.
Here is the code:
1 from django.contrib.auth.models import User
2 from django.test import TestCase
3 from django.core.urlresolvers import reverse
4
5 class UsersTests(TestCase):
6 def setUp(self):
7 self.john = User.objects.create_user('john',
'
jo...@example.com', '123456')
8 self.jack = User.objects.create_user('jack',
'
ja...@example.com', '7891011')
9
10 def test_reverse(self):
11 print __file__, 1, User.objects.all()
12 link = reverse('homepage')
13 print __file__, 2, User.objects.all()
And the output is:
userprofile/tests.py 1 [<User: john>, <User: jack>]
userprofile/tests.py 2 []
.
----------------------------------------------------------------------
Ran 1 test in 0.261s
Is this the expect output with the updates to django test framework? I
dont understand why this happens...
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to
django-d...@googlegroups.com.
To unsubscribe from this group, send email to
django-develop...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.