mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Refs #26022 -- Used context manager version of assertRaises in tests.
This commit is contained in:
parent
575706331b
commit
3d0dcd7f5a
118 changed files with 1086 additions and 760 deletions
|
@ -33,7 +33,8 @@ class ManyToManyTests(TestCase):
|
|||
# Create an Article.
|
||||
a5 = Article(id=None, headline='Django lets you reate Web apps easily')
|
||||
# You can't associate it with a Publication until it's been saved.
|
||||
self.assertRaises(ValueError, getattr, a5, 'publications')
|
||||
with self.assertRaises(ValueError):
|
||||
getattr(a5, 'publications')
|
||||
# Save it!
|
||||
a5.save()
|
||||
# Associate the Article with a Publication.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue