ghostly.django.testcase

Module containing GhostlyDjangoTestCase.

class ghostly.django.testcase.GhostlyDjangoTestCase(methodName='runTest')[source]

Bases: django.contrib.staticfiles.testing.StaticLiveServerTestCase

Django TestCase that allows you to define your Ghostly tests pragmatically.

This class is mostly a light weight wrapper around Ghostly.

assertCurrentUrl(expected)[source]

Assert the current URL is equal to expected.

Parameters:expected – Expected URL, if relative the test servers URL is prepended.
assertXpathEqual(xpath, expected)[source]
assertXpathNotVisible(xpath)[source]
assertXpathVisible(xpath)[source]
driver = 'PhantomJS'
goto(url)[source]

Helper method to perform a HTTP GET with support for relative URLs.

Parameters:
  • url (str) – The URL to retrieve, if relative the test servers URL is prepended.
  • assert_statuses (list) – A list of acceptable status codes.
maximise_window = True
setUp()[source]