#36280: Replace cm.exception.messages with assertRaisesMessage() in tests
-------------------------------------+-------------------------------------
     Reporter:  Tim Graham           |                    Owner:  Georgii
         Type:                       |  (George) Randiuk
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Other)         |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Clifford Gama):

 The following pattern used to test assertions looks like it could also be
 covered by this ticket, maybe with the exception of tests for
 `assertRaisesMessage` itself?
 {{{#!python
         try:
             self.assertRedirects(response, "/get_view/")
         except AssertionError as e:
             self.assertIn(
                 "Response redirected to '/get_view/?var=value', expected
 '/get_view/'",
                 str(e),
             )
 }}}
 e.g. in `test_client_regress.tests.*`, where this pattern is used
 extensively and interchangeably with `assertRaisesMessage`.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36280#comment:9>
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 visit 
https://groups.google.com/d/msgid/django-updates/010701969f597e95-a69c2588-a544-4e87-8ccd-e410452477d2-000000%40eu-central-1.amazonses.com.

Reply via email to