#24965: Make LiveServerTestCase.live_server_url accessible from class
-------------------------------------+-------------------------------------
Reporter: MoritzS | Owner:
Type: | Status: new
Cleanup/optimization |
Component: Testing framework | Version: master
Severity: Normal | Keywords: selenium tests live
| server test case url
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Consider following test:
{{{
class MySeleniumTest(LiveServerTestCase):
@classmethod
def setUpClass(cls):
super(MySeleniumTest, cls).setUpClass()
# initialize selenium driver
cls.selenium = WebDriver()
# initialize browser state, live_server_url is needed here
cls.selenium.get(cls.live_server_url)
# [...]
}}}
Right now this doesn't work, because `live_server_url` is a property even
though it only consists of class attributes.
Since class properties are a bit more complicated I suggest adding a
`get_live_server_url` classmethod and keeping the `live_server_url`.
An alternative is to deprecate `live_server_url` but I don't think that's
really necessary.
--
Ticket URL: <https://code.djangoproject.com/ticket/24965>
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/050.874537aeb3cc30586e2102e9bfeaf1b9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.