This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Helpers for creating high-level functional tests in Django, with a unified API for WebTest and Selenium tests.

Documentation

The full documentation is at https://django-functest.readthedocs.org.

Installation

pip install django-functest

Features

  • A simplified API for writing functional tests in Django (tests that check the behaviour of entire views, or sets of views, e.g. a checkout process).
  • A unified API that abstracts over both WebTest and Selenium - write two tests at once!
  • Many of the gotchas and difficulties of using WebTest and Selenium ironed out for you.
  • Well tested - as well as its own test suite, which is run against Firefox, Chrome, and PhantomJS, it is also used by Wolf & Badger for tests covering many business critical functionalities.

Typical usage

In your tests.py:

from django.test import LiveServerTestCase, TestCase
from django_functest import FuncWebTestMixin, FuncSeleniumMixin

class ContactTestBase(object):

    def test_contact_form(self):
        self.get_url('contact_form')
        self.fill({'#id_name': 'Joe',
                   '#id_message': 'Hello'})
        self.submit('input[type=submit]')
        self.assertTextPresent("Thanks for your message")

 class ContactWebTest(FuncWebTestMixin, TestCase):
     pass

 class ContactSeleniumTest(FuncSeleniumMixin, LiveServerTestCase):
     pass

In this way, you can write a single test with a high-level API, and run it in two way - using a fast, WSGI-based method which emulates typical HTTP usage of a browser, and using a full browser that actually executes Javascript (if present) etc.

Under the hood, the WSGI-based method uses and builds upon WebTest and django-webtest.

django-functest provides its functionality as mixins, so that you can have your own base class for tests.

Running Tests

To run the tests:

source <YOURVIRTUALENV>/bin/activate
(myenv) $ ./setup.py develop
(myenv) $ ./runtests.py

Or, to run on all environments:

pip install tox
tox

Firefox tests are currently failing due to incompatibilities with recent Firefox versions (>= 47) and all published versions of Selenium (< 3.0).

This can be worked around by downloading an old version of Firefox from https://www.mozilla.org/en-US/firefox/organizations/all/ and using runtests.py –firefox-binary

Credits

This library was built by developers at Wolf & Badger, released with the kind permission of that company.

Tools used in rendering this package:

History

0.1.8

  • Django 1.10 compatibility

0.1.7

  • Fixed performance/reliability issue caused by browsers attempting to retrieve /favicon.ico after visiting emptypage.

0.1.6

  • Fixed bug where elements wouldn’t scroll into view if html height is set to 100%
  • New method get_webdriver_options for customizing WebDriver behaviour.

0.1.5

  • Added get_session_data()
  • Improved reliability of FuncSeleniumMixin.get_literal_url()
  • Allow <select> elements to be set using integers for values.
  • Fixed issues with .value() for radio buttons and text areas
  • Fixed bug with setting radio buttons when there are more than one set of radio buttons in the form.

0.1.4

  • Added support for file uploads

0.1.3

  • Support for filling radio buttons
  • More convenient support for quotes and apostrophes (” ‘) in text assertion methods.

0.1.2

  • Fixed wheel building - again!

0.1.1

  • Fixed packaging bug that caused wheels to fail on Python 3.

0.1.0

  • First release on PyPI.
Release History

Release History

0.1.8

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_functest-0.1.8-py2-none-any.whl (31.3 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Sep 29, 2016
django_functest-0.1.8-py3-none-any.whl (31.2 kB) Copy SHA256 Checksum SHA256 3.4 Wheel Sep 29, 2016
django-functest-0.1.8.tar.gz (42.7 kB) Copy SHA256 Checksum SHA256 Source Sep 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting