Ticket #14766: 14766.diff

File 14766.diff, 925 bytes (added by Rob Hudson, 9 years ago)
  • tests/regressiontests/model_fields/tests.py

    diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py
    index a0b4593..1cfee91 100644
    a b from decimal import Decimal 
    33
    44from django import test
    55from django import forms
    6 from django.core.exceptions import ValidationError
     6from django.core.exceptions import FieldError, ValidationError
    77from django.db import models
    88from django.db.models.fields.files import FieldFile
    99from django.utils import unittest
    class FileFieldTests(unittest.TestCase): 
    348348        field = d._meta.get_field('myfile')
    349349        field.save_form_data(d, 'else.txt')
    350350        self.assertEqual(d.myfile, 'else.txt')
     351
     352class FieldErrorTest(unittest.TestCase):
     353    def test_field_error(self):
     354        self.assertRaises(FieldError, Post.objects.order_by, 'nonexistant_field')
     355
Back to Top