File tree Expand file tree Collapse file tree 1 file changed +23
-23
lines changed Expand file tree Collapse file tree 1 file changed +23
-23
lines changed Original file line number Diff line number Diff line change 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'))
You can’t perform that action at this time.
0 commit comments