#34730: Add an assertMessages assertion
-----------------------------------+--------------------------------------
Reporter: François Freitag | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by François Freitag):
I agree, importing an optional, contrib app in the core of `django.test`
isn’t great. The reason I chose to do it was to make the assertion more
visible and easier to use.
Note that the import from `django.contrib.messages` happens when the
assertion is called, so the dependency only exists when the assertion is
called. I thought it was an acceptable trade-off, but a contrib app
assertion would still be available to projects who don’t use
`django.contrib.messages`.
Projects I worked on often added assertions or setUp/tearDown to
`SimpleTestCase`, I assume that’s fairly common and shouldn’t be a big
deal for others to add the mixin.
If we’re all in agreement with Tim’s proposal, I can move the helper to
`django.contrib.messages.test`.
--
Ticket URL: <https://code.djangoproject.com/ticket/34730#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018988698825-a867a5f3-130e-4d39-a2f2-26abbf842c02-000000%40eu-central-1.amazonses.com.