Example test code using nose

7 views
Skip to first unread message

Louie

unread,
Sep 25, 2009, 1:18:55 PM9/25/09
to ISP Configuration Database
from django.test import TestCase
2 from ispdb.config import views
3 from django.core.urlresolvers import reverse
4 from ispdb.config import models
5
6 class FirstTest(TestCase):
7 def testAsk(self):
8 self.client.post(reverse('ispdb_add'),
{'asking_or_adding':'asking','fo rm-TOTAL_FORMS':'1','form-
INITIAL_FORMS':'1','form-0-name':'ty.com'})
9 domain = models.UnclaimedDomain.objects.get(name='ty.com')
10 assert isinstance(domain,models.UnclaimedDomain)
11
12 def testAdd(self):
13 self.client.post(reverse('ispdb_add'),{})
Reply all
Reply to author
Forward
0 new messages