Ticket #5427: invalid_models.diff

File invalid_models.diff, 1.3 KB (added by mcroydon, 12 years ago)

Added invalid model patch

  • tests/modeltests/invalid_models/models.py

    1010    charfield = models.CharField()
    1111    decimalfield = models.DecimalField()
    1212    filefield = models.FileField()
    13     prepopulate = models.CharField(max_length=10, prepopulate_from='bad')
    1413    choices = models.CharField(max_length=10, choices='bad')
    1514    choices2 = models.CharField(max_length=10, choices=[(1,2,3),(1,2,3)])
    1615    index = models.CharField(max_length=10, db_index='bad')
    111110invalid_models.fielderrors: "decimalfield": DecimalFields require a "decimal_places" attribute.
    112111invalid_models.fielderrors: "decimalfield": DecimalFields require a "max_digits" attribute.
    113112invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
    114 invalid_models.fielderrors: "prepopulate": prepopulate_from should be a list or tuple.
    115113invalid_models.fielderrors: "choices": "choices" should be iterable (e.g., a tuple or list).
    116114invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
    117115invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
Back to Top