Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. """
  2. _   _                                              
  3. (_) | |_      ___   _   _   _ __   ___    ___    ___
  4. | | | __|    / __| | | | | | '__| / __|  / _ \ / __|
  5. | | | |_    | (__  | |_| | | |    \__ \ | (_) | \__ \
  6. |_|  \__|    \___|  \__,_| |_|    |___/  \___/  |___/
  7.  
  8.  
  9. Testes para IT DEV1d-1103-A1-7T12
  10.  
  11. Lucas Castro <lucas.castro@ithub.com.br>
  12. Julho/2011
  13. """
  14.  
  15. from django.utils import unittest
  16. from sucuri.models import Task
  17. from django.test import TestCase
  18.  
  19. class TaskTest(unittest.TestCase):
  20.     def setUp(self):
  21.         self.task = Task()
  22.    
  23.     def test_task_has_title(self):
  24.         """
  25.        Testa que o objeto task possui o atributo title.
  26.        """
  27.         task_attributes = self.task.__dict__
  28.         self.assertTrue(task_attributes.has_key('title'))
  29.  
  30.     def test_task_has_description(self):
  31.         """
  32.        Testa que o objeto task possui o atributo description.
  33.        """
  34.         task_attributes = self.task.__dict__
  35.         self.assertTrue(task_attributes.has_key('description'))
  36.  
  37.  
  38. class TestSucuriViews(TestCase):
  39.     def test_index(self):
  40.         """
  41.        Testa que a aplicacao responde com o template de task chamado index.
  42.         """
  43.         response = self.client.get('/tasks/')
  44.         self.assertTemplateUsed(response, 'tasks/index.html', msg_prefix='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement