#27253: Use assertIsInstance() in test_force_text_lazy
-----------------------------------+--------------------
     Reporter:  cjerdonek          |      Owner:  nobody
         Type:  Uncategorized      |     Status:  new
    Component:  Testing framework  |    Version:  master
     Severity:  Normal             |   Keywords:
 Triage Stage:  Unreviewed         |  Has patch:  0
Easy pickings:  1                  |      UI/UX:  0
-----------------------------------+--------------------
 It looks like it would be cleaner / simpler to be using
 `assertIsInstance()` here
 
([https://github.com/django/django/blob/b5aac66b28c615b2bda63548cbd695dbb5a0c381/tests/utils_tests/test_encoding.py#L35
 direct code link]):

 {{{#!python
 def test_force_text_lazy(self):
     s = SimpleLazyObject(lambda: 'x')
     self.assertTrue(issubclass(type(force_text(s)), six.text_type))
 }}}

 So it would be:

 {{{#!python
 def test_force_text_lazy(self):
     s = SimpleLazyObject(lambda: 'x')
     self.assertIsInstance(force_text(s), six.text_type)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27253>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.294db32b5f6d7163b8a4f8db52cc3509%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to