Ticket #16694: 16694.patch
File 16694.patch, 1.1 KB (added by , 13 years ago) |
---|
-
tests/modeltests/invalid_models/invalid_models/models.py
5 5 This example exists purely to point out errors in models. 6 6 """ 7 7 8 from django.db import models8 from django.db import connection, models 9 9 10 10 class FieldErrors(models.Model): 11 11 charfield = models.CharField() … … 342 342 invalid_models.nonexistingorderingwithsingleunderscore: "ordering" refers to "does_not_exist", a field that doesn't exist. 343 343 invalid_models.invalidsetnull: 'fk' specifies on_delete=SET_NULL, but cannot be null. 344 344 invalid_models.invalidsetdefault: 'fk' specifies on_delete=SET_DEFAULT, but has no default value. 345 invalid_models.primarykeynull: "my_pk_field": Primary key fields cannot have null=True.346 345 """ 346 347 if not connection.features.interprets_empty_strings_as_nulls: 348 model_errors += """invalid_models.primarykeynull: "my_pk_field": Primary key fields cannot have null=True. 349 """