Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- _ _
- (_) | |_ ___ _ _ _ __ ___ ___ ___
- | | | __| / __| | | | | | '__| / __| / _ \ / __|
- | | | |_ | (__ | |_| | | | \__ \ | (_) | \__ \
- |_| \__| \___| \__,_| |_| |___/ \___/ |___/
- Testes para IT DEV1d-1103-A1-7T12
- Lucas Castro <lucas.castro@ithub.com.br>
- Julho/2011
- """
- from django.utils import unittest
- from sucuri.models import Task
- from django.test import TestCase
- class TaskTest(unittest.TestCase):
- def setUp(self):
- self.task = Task()
- def test_task_has_title(self):
- """
- Testa que o objeto task possui o atributo title.
- """
- task_attributes = self.task.__dict__
- self.assertTrue(task_attributes.has_key('title'))
- def test_task_has_description(self):
- """
- Testa que o objeto task possui o atributo description.
- """
- task_attributes = self.task.__dict__
- self.assertTrue(task_attributes.has_key('description'))
- class TestSucuriViews(TestCase):
- def test_index(self):
- """
- Testa que a aplicacao responde com o template de task chamado index.
- """
- response = self.client.get('/tasks/')
- self.assertTemplateUsed(response, 'tasks/index.html', msg_prefix='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement