#24965: Make LiveServerTestCase.live_server_url accessible from class
-------------------------------------+-------------------------------------
     Reporter:  MoritzS              |                    Owner:  MoritzS
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  selenium tests live  |             Triage Stage:  Accepted
  server test case url               |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by MoritzS):

 How should I do that?
 I could do something like
 {{{
 class TestLiveServerTestCase(LiveServerTestCase):
     @classmethod
     def setUpClass(cls):
         super(TestLiveServerTestCase, cls).setUpClass()
         if isinstance(cls.live_server_url, str):
             cls._test_worked = True
         else:
             cls._test_worked = False

     def test_worked(self):
         self.assertTrue(self._test_worked)
 }}}

 But that feels really hackish.
 And instanciating `LiveServerTestCase` inside a `SimpleTestCase` isn't
 that trivial, I think.

--
Ticket URL: <https://code.djangoproject.com/ticket/24965#comment:8>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.b7ab186274154d18d144ffe9aad4e297%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to