Skip to content

Commit d2ea1c1

Browse files
committed
Test if user model affect code coverage
1 parent a3eb34a commit d2ea1c1

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
2-
from django.test import TestCase
3-
from django.contrib.auth import get_user_model
4-
5-
User = get_user_model()
6-
7-
8-
class StudentTest(TestCase):
9-
def setUp(self):
10-
self.data = {
11-
'username': 'Peter',
12-
'email': 'peter@example.com'
13-
}
14-
self.instance = User(**self.data)
15-
16-
def test_model_can_create_instance(self):
17-
""" Test if the model can create an instance."""
18-
old_count = User.objects.count()
19-
self.instance.save()
20-
new_count = User.objects.count()
21-
22-
self.assertNotEqual(old_count, new_count)
23-
self.assertEqual(self.instance.username, self.data.get('username'))
1+
#
2+
# from django.test import TestCase
3+
# from django.contrib.auth import get_user_model
4+
#
5+
# User = get_user_model()
6+
#
7+
#
8+
# class StudentTest(TestCase):
9+
# def setUp(self):
10+
# self.data = {
11+
# 'username': 'Peter',
12+
# 'email': 'peter@example.com'
13+
# }
14+
# self.instance = User(**self.data)
15+
#
16+
# def test_model_can_create_instance(self):
17+
# """ Test if the model can create an instance."""
18+
# old_count = User.objects.count()
19+
# self.instance.save()
20+
# new_count = User.objects.count()
21+
#
22+
# self.assertNotEqual(old_count, new_count)
23+
# self.assertEqual(self.instance.username, self.data.get('username'))

0 commit comments

Comments
 (0)