~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to tests/validation/test_error_messages.py

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog
  • Date: 2014-09-17 14:15:11 UTC
  • mfrom: (1.3.17) (6.2.18 experimental)
  • Revision ID: package-import@ubuntu.com-20140917141511-icneokthe9ww5sk4
Tags: 1.7-2
* Release to unstable.
* Add a migrate-south sample script to help users apply their South
  migrations. Thanks to Brian May.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- encoding: utf-8 -*-
2
2
from __future__ import unicode_literals
3
3
 
 
4
from unittest import TestCase
 
5
 
4
6
from django.core.exceptions import ValidationError
5
7
from django.db import models
6
 
from django.utils import six
7
 
from django.utils.unittest import TestCase
8
8
 
9
9
 
10
10
class ValidationMessagesTest(TestCase):
18
18
        f = models.AutoField(primary_key=True)
19
19
        self._test_validation_messages(f, 'fõo',
20
20
            ["'fõo' value must be an integer."])
21
 
        # primary_key must be True. Refs #12467.
22
 
        with six.assertRaisesRegex(self, AssertionError,
23
 
                "AutoFields must have primary_key=True."):
24
 
            models.AutoField(primary_key=False)
25
21
 
26
22
    def test_integer_field_raises_error_message(self):
27
23
        f = models.IntegerField()