Exemplo n.º 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))
Exemplo n.º 2
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))
Exemplo n.º 3
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name')
     mtv.full_clean()
Exemplo n.º 4
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name', id=123)
     setattr(mtv, '_adding', True)
     mtv.full_clean()
Exemplo n.º 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))
Exemplo n.º 6
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name')
     mtv.full_clean()
Exemplo n.º 7
0
 def test():
     mtv = ModelToValidate(number=10, name='Some Name', id=123)
     setattr(mtv, '_adding', True)
     mtv.full_clean()
Exemplo n.º 8
0
 def test():
     mtv = ModelToValidate(number=10, name="Some Name", id=123)
     setattr(mtv, "_adding", True)
     mtv.full_clean()
Exemplo n.º 9
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))