Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
- from django.test import TestCase
- class (TestCase):
- def setUp(self):
- self.superuser = User.objects.create_superuser(
- email='email@email.com',
- password='V&ryD@f3Pwd',
- name='Super User')
- self.login = self.client.login(email='email@email.com', password='V&ryD@f3Pwd')
- self.resp = self.client.get('/mouses')
- def test_login(self):
- """ Check if is logged """
- self.assertTrue(self.login)
- def test_html(self):
- """ HTML must contains input tags """
- tags = (('<h1>Mouse populations'),
- ('<th>ID'),
- ('<th>Age'),
- ('<th>Skin color'),
- ('<th>Gender'),)
- for text in tags:
- with self.subTest():
- self.assertContains(self.resp, text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement