Skip to content

Instantly share code, notes, and snippets.

@gilsondev
Created July 31, 2012 18:21
Show Gist options
  • Save gilsondev/3219184 to your computer and use it in GitHub Desktop.
Save gilsondev/3219184 to your computer and use it in GitHub Desktop.
Classe de Teste da view de subscriptions
from django.core.urlresolvers import reverse as r
# ...
class SubscribeViewTest(TestCase):
def setUp(self):
self.resp = self.client.get(r('subscriptions:subscribe'))
def test_get(self):
'Ao visitar /inscricao/ a página de inscrição é exibida'
self.assertEquals(200, self.resp.status_code)
def test_use_template(self):
self.assertTemplateUsed(self.resp,
'subscriptions/subscription_form.html')
def test_has_form(self):
'A resposta deve contar o formulário de inscrição'
self.assertIsInstance(self.resp.context['form'], SubscriptionForm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment