~ubuntu-branches/ubuntu/utopic/python-django/utopic

« back to all changes in this revision

Viewing changes to tests/modeltests/many_to_many/tests.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (1.1.21) (4.4.27 sid)
  • Revision ID: package-import@ubuntu.com-20130509151047-aqv8d71oj9wvcv8c
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from __future__ import absolute_import, with_statement
 
1
from __future__ import absolute_import
2
2
 
3
3
from django.test import TestCase
 
4
from django.utils import six
4
5
 
5
6
from .models import Article, Publication
6
7
 
52
53
            ])
53
54
 
54
55
        # Adding an object of the wrong type raises TypeError
55
 
        with self.assertRaisesRegexp(TypeError, "'Publication' instance expected, got <Article.*"):
 
56
        with six.assertRaisesRegex(self, TypeError, "'Publication' instance expected, got <Article.*"):
56
57
            a6.publications.add(a5)
57
58
        # Add a Publication directly via publications.add by using keyword arguments.
58
59
        p4 = a6.publications.create(title='Highlights for Adults')