Beispiel #1
0
 def test_primary_key_unique_check_performed_when_adding_and_pk_specified(self):
     # Regression test for #12560
     query_count = len(connection.queries)
     mtv = ModelToValidate(number=10, name='Some Name', id=123)
     setattr(mtv, '_adding', True)
     mtv.full_clean()
     self.assertEqual(query_count + 1, len(connection.queries))
 def test_primary_key_unique_check_performed_when_adding_and_pk_specified(
         self):
     # Regression test for #12560
     query_count = len(connection.queries)
     mtv = ModelToValidate(number=10, name='Some Name', id=123)
     setattr(mtv, '_adding', True)
     mtv.full_clean()
     self.assertEqual(query_count + 1, len(connection.queries))
Beispiel #3
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name')
     mtv.full_clean()
Beispiel #4
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name', id=123)
     setattr(mtv, '_adding', True)
     mtv.full_clean()
Beispiel #5
0
 def test_primary_key_unique_check_not_performed_when_not_adding(self):
     # Regression test for #12132
     query_count= len(connection.queries)
     mtv = ModelToValidate(number=10, name='Some Name')
     mtv.full_clean()
     self.assertEqual(query_count, len(connection.queries))
Beispiel #6
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name')
     mtv.full_clean()
Beispiel #7
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name', id=123)
     setattr(mtv, '_adding', True)
     mtv.full_clean()
Beispiel #8
0
 def test():
     mtv = ModelToValidate(number=10, name="Some Name", id=123)
     setattr(mtv, "_adding", True)
     mtv.full_clean()
 def test_primary_key_unique_check_not_performed_when_not_adding(self):
     # Regression test for #12132
     query_count = len(connection.queries)
     mtv = ModelToValidate(number=10, name='Some Name')
     mtv.full_clean()
     self.assertEqual(query_count, len(connection.queries))