Ticket #31298: test_run.py

File test_run.py, 593 bytes (added by Shaily, 4 years ago)

test_run.py

Line 
1from django.test import TestCase
2from django.contrib.auth import get_user_model
3
4
5User = get_user_model()
6
7class DemoTest(TestCase):
8 fixtures = ['app1fixture', 'auth', 'app2fixture', 'app3fixture']
9
10 def test_demo(self):
11 u = User.objects.create(username='Apple')
12 self.assertEqual(u.username, 'Apple')
13
14class DemoTest2(TestCase):
15 fixtures = ['app1fixture', 'auth', 'app2fixture', 'app3fixture']
16
17 def test_demo2(self):
18 u = User.objects.create(username='Banana')
19 self.assertEqual(u.username, 'Banana')
20 self.assertEqual(u.username, 'Banana')
Back to Top