Advertisement
Guest User

Untitled

a guest
May 16th, 2017
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.test import TestCase
  4.  
  5. class (TestCase):
  6. def setUp(self):
  7. self.superuser = User.objects.create_superuser(
  8. email='email@email.com',
  9. password='V&ryD@f3Pwd',
  10. name='Super User')
  11. self.login = self.client.login(email='email@email.com', password='V&ryD@f3Pwd')
  12. self.resp = self.client.get('/mouses')
  13.  
  14. def test_login(self):
  15. """ Check if is logged """
  16. self.assertTrue(self.login)
  17.  
  18. def test_html(self):
  19. """ HTML must contains input tags """
  20. tags = (('<h1>Mouse populations'),
  21. ('<th>ID'),
  22. ('<th>Age'),
  23. ('<th>Skin color'),
  24. ('<th>Gender'),)
  25.  
  26. for text in tags:
  27. with self.subTest():
  28. self.assertContains(self.resp, text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement