Created
July 31, 2012 18:21
-
-
Save gilsondev/3219184 to your computer and use it in GitHub Desktop.
Classe de Teste da view de subscriptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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