django-webtest


Namedjango-webtest JSON
Version 1.9.11 PyPI version JSON
download
home_pagehttps://github.com/django-webtest/django-webtest
SummaryInstant integration of Ian Bicking's WebTest (http://docs.pylonsproject.org/projects/webtest/) with Django's testing framework.
upload_time2023-09-18 18:22:57
maintainer
docs_urlNone
authorMikhail Korobov
requires_python
licenseMIT license
keywords django webtest pytest
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==============
django-webtest
==============

.. image:: https://img.shields.io/pypi/v/django-webtest.svg
   :target: https://pypi.python.org/pypi/django-webtest
   :alt: PyPI Version

.. image:: https://img.shields.io/github/license/kmike/django-webtest.svg
   :target: https://github.com/django-webtest/django-webtest/blob/master/LICENSE.txt
   :alt: License

.. image:: https://img.shields.io/travis/django-webtest/django-webtest/master.svg
   :target: http://travis-ci.org/django-webtest/django-webtest
   :alt: Build Status

django-webtest is an app for instant integration of Ian Bicking's
WebTest (http://docs.pylonsproject.org/projects/webtest/) with Django's
testing framework.

Installation
============

.. code-block:: console

    $ pip install django-webtest

Usage
=====

.. code-block:: python

    from django_webtest import WebTest

    class MyTestCase(WebTest):

        # optional: we want some initial data to be able to login
        fixtures = ['users', 'blog_posts']

        # optional: default extra_environ for this TestCase
        extra_environ = {'HTTP_ACCEPT_LANGUAGE': 'ru'}

        def testBlog(self):
            # pretend to be logged in as user `kmike` and go to the index page
            index = self.app.get('/', user='kmike')

            # All the webtest API is available. For example, we click
            # on a <a href='/tech-blog/'>Blog</a> link, check that it
            # works (result page doesn't raise exceptions and returns 200 http
            # code) and test if result page have 'My Article' text in
            # its body.
            assert 'My Article' in index.click('Blog')

django-webtest provides a django.test.TestCase subclass
(``django_webtest.WebTest``) that creates ``webtest.TestApp`` around
django wsgi interface and makes it available in tests as ``self.app``.

It also features an optional ``user`` argument for ``self.app.get``,
``self.app.post``, etc. to help making authorized requests. This argument
should be a django.contrib.auth.models.User instance or a string with user's
``username`` for the user who is supposed to be logged in. To log out again,
call ``self.app.reset``, clearing all cookies.  To make a bunch of calls
with the same user, call ``app.set_user(user)`` before your requests; if
you want to disable that user, call ``app.get(..., user=None)`` for one
request or ``app.set_user(None)`` to unset the user for all following calls.

For 500 errors original traceback is shown instead of usual html result
from handler500.

You also get the ``response.templates`` and ``response.context`` goodness that
is usually only available if you use Django's native test client. These
attributes contain a list of templates that were used to render the response
and the context used to render these templates. All of Django's native asserts (
``assertFormError``,  ``assertTemplateUsed``, ``assertTemplateNotUsed``,
``assertContains``, ``assertNotContains``, ``assertRedirects``) are
also supported for WebTest responses.

The session dictionary is available via ``self.app.session``, and has the
same content than Django's native test client.

Unlike Django's native test client CSRF checks are not suppressed
by default so missing CSRF tokens will cause test fails (and that's good).

If forms are submitted via WebTest forms API then all form fields (including
CSRF token) are submitted automagically:

.. code-block:: python

    class AuthTest(WebTest):
        fixtures = ['users.json']

        def test_login(self):
            form = self.app.get(reverse('auth_login')).form
            form['username'] = 'foo'
            form['password'] = 'bar'
            response = form.submit().follow()
            self.assertEqual(response.context['user'].username, 'foo')

However if forms are submitted via raw POST requests using ``app.post`` then
csrf tokens become hard to construct. CSRF checks can be disabled by setting
``csrf_checks`` attribute to False in this case:

.. code-block:: python

    class MyTestCase(WebTest):
        csrf_checks = False

        def test_post(self):
            self.app.post('/')

When a subclass of Django's ``TransactionTestCase`` is desired,
use ``django_webtest.TransactionWebTest``.

For disabling CSRF checks in a ``pytest-django`` fixture, see
`Usage with PyTest`_.

All of these features can be easily set up manually (thanks to WebTest
architecture) and they are even not neccessary for using WebTest with Django but
it is nice to have some sort of integration instantly.

See http://docs.pylonsproject.org/projects/webtest/ for API help. Webtest can
follow links, submit forms, parse html, xml and json responses with different
parsing libraries, upload files and more.

Integration with django-rest-framework
======================================

If your project uses django-rest-framework__, the setting
``REST_FRAMEWORK['AUTHENTICATION_CLASSES']`` will be patched
automatically to include a class that links the rest-framework
authentication system with ``app.get(user=user)``.

.. __: https://www.django-rest-framework.org/

Usage with PyTest
=================

You need to install `pytest-django <https://pytest-django.readthedocs.io>`_:

.. code-block:: console

    $ pip install pytest-django

Then you can use ``django-webtest``'s fixtures:

.. code-block:: python

    def test_1(django_app):
        resp = django_app.get('/')
        assert resp.status_code == 200, 'Should return a 200 status code'

We have a ``django_app_factory`` fixture we can use to create custom fixtures.
For example, one that doesn't do CSRF checks:

.. code-block:: python

    # conftest.py

    @pytest.fixture
    def csrf_exempt_django_app(django_app_factory):
        return django_app_factory(csrf_checks=False)

``csrf_checks`` and ``extra_environ`` are the only arguments to
``django_app_factory``.


Why?
====

While django.test.client.Client is fine for its purposes, it is not
well-suited for functional or integration testing. From Django's test client
docstring:

    This is not intended as a replacement for Twill/Selenium or
    the like - it is here to allow testing against the
    contexts and templates produced by a view, rather than the
    HTML rendered to the end-user.

WebTest plays on the same field as twill. WebTest has a nice API,
is fast, small, talks to the django application via WSGI instead of HTTP
and is an easy way to write functional/integration/acceptance tests.
django-webtest is able to provide access to the names of rendered templates
and template context just like native Django TestClient.

Contributing
============

Development happens at github: https://github.com/django-webtest/django-webtest
Issue tracker: https://github.com/django-webtest/django-webtest/issues

Feel free to submit ideas, bugs or pull requests.

Running tests
-------------

Make sure `tox`_ is installed and run:

.. code-block:: console

    $ tox

from the source checkout.

.. _tox: http://tox.testrun.org



CHANGES
=======

1.9.11 (2023-09-18)
-------------------

- Add support for official Python & Django versions

- Do not insert  WebtestAuthentication to the head of DEFAULT_AUTHENTICATION_CLASSES.

1.9.10 (2022-03-02)
-------------------

- Add an optional WebTest backend that does not interfere with handling of permissions by
  custom backends. Accessible via WEBTEST_AUTHENTICATION_BACKEND setting. Fixed #123


1.9.9 (2021-12-27)
------------------

- Add Django 4 support

- Remove Django 2 support


1.9.8 (2021-10-06)
------------------

- Update testing configurations for Django and Python as per Django documentation
    - https://docs.djangoproject.com/en/3.0/faq/install/#what-python-version-can-i-use-with-django

- Add some useful metadata for the project's PyPI listing

- Minor changes to documentation

- Update getting session in DjangoTestApp.  Fixed #113

- Remove py27/py35 support


1.9.7 (2019-07-05)
------------------

- allow overriding HTTP_HOST with DjangoTestApp.__init__. Fixed #102


1.9.6 (2019-06-07)
------------------

- rest_framework auth class. Fixed #98 #100


1.9.5 (2019-05-31)
------------------

- Fix compatibility with django 3. See #96

- Add integration with django-rest-framework auth

- Add missing args to DjangoTestApp. Fixed #86


1.9.4 (2018-10-27)
------------------

- py34 and Django 1.8 are no longer tested (but may works)

- allow to use positionnal args; fixed #89

- remove deprecated pytest.yield_fixture functions. use pytest.fixture instead;
  fixed #88

- Don't add duplicate WebtestUserMiddleware to the list of middlewares in
  WebTestMixin. fixed #87

- restore MIDDLEWARE_CLASSES support; fixed #84


1.9.3 (2018-05-03)
------------------

- Passing `user=None` to get/post/etc. methods will clear a user
  previously set with `set_user` instead of doing nothing.

- Avoid sharing settings between tests in pytest plugin

- Fix middleware settings name used


1.9.2 (2017-05-17)
------------------

- silence warnings about is_authenticated on 1.11

- include correct hostname (testserver) when using set_cookie


1.9.1 (2017-03-09)
------------------

- Fix package description (multiline are no longer allowed by pypi)


1.9.0 (2017-03-09)
------------------

- Backward incompatibility: positionnal arguments are no longer supported.
  You'll need to replace them by keywords arguments.

- Added support for Django 1.11

- Dropped support for Django <= 1.7

- Dropped support for Python 2.6

- Changed value of `HTTP_HOST` header from `localhost` to `testserver`, to
  match behaviour of Django test client.

- Fixed `DjangoTestApp.options`

- Added `DjangoTestApp.head`

- Added pytest fixtures


1.8.0 (2016-09-14)
------------------

- Fixed issue #40 - combining ``app.get`` ``auto_follow=True`` with other
  keyword args.

- Add compatibility to the MIDDLEWARE setting introduced in django 1.10

- Drop support for django 1.2

1.7.9 (2016-04-19)
------------------

- Add set_user() to allow to set a user globally for the app

- Allow 'click' to be given a user param

- Mention testapp.reset() in readme

- Allow to use ``json_`` methods

1.7.8 (2015-04-21)
------------------

- setup.py is switched to setuptools; WebTest is now installed automatically
  (thanks Eric Araujo);
- importlib from stdlib is used when available, for django 1.9 compatibility
  (thanks Helen Sherwood-Taylor);
- django-webtest's own tests are fixed to work in django 1.6+;
- https://bitbucket.org/kmike/django-webtest repository is no longer supported.

1.7.7 (2014-03-25)
------------------

- Fix installation for Python 3.x on systems with C locales.

1.7.6 (2014-01-20)
------------------

- DjangoTestApp methods pass all custom keyword arguments to webtest.TestApp;
  this allows to use ``xhr=True`` feature (thanks Max Kharandziuk).
- Travis CI testing fixes (thanks Darian Moody).

1.7.5 (2013-07-17)
------------------

- OPTIONS method is fixed;
- added workaround for DELETE method warnings
  (see https://github.com/Pylons/webtest/issues/50).

1.7.4 (2013-07-14)
------------------

- Really add ``TransactionWebTest`` base class (thanks Julien Aubert).

1.7.3 (2013-07-07)
------------------

- Added support for PATCH and OPTIONS HTTP methods (thanks Will Bradley).

1.7.2 (2013-06-27)
------------------

- ``TransactionWebTest`` base class is added (thanks Iurii Kriachko).

1.7.1 (2013-06-11)
------------------

- Added support for non-ascii usernames.

1.7 (2013-05-23)
----------------

- Added support for django 1.6 (thanks Carl Meyer).

1.6.1 (2013-03-31)
------------------

- Added support for django 1.5+ custom user models (thanks Gautier Hayoun).

1.6 (2013-03-07)
----------------

- Added ability to pass a custom response_class and app_class to WebTest
  (thanks Bruno Renié);
- Added case-insensitive header access in DjangoWebtestResponse (thanks
  Bruno Renié).

1.5.7 (2013-02-27)
------------------

- WebTest 2.0 support.

1.5.6 (2013-01-21)
------------------

- django 1.5 support: transaction handling is fixed (thanks Marco Braak).

1.5.5 (2013-01-14)
------------------

- Fixed django 1.5 support: DjangoWebtestResponse.streaming attribute
  is added (thanks David Winterbottom).

1.5.4 (2012-09-13)
------------------

- fix django 1.5 issues with AdminMediaHandler (thanks Tai Lee);
- tox.ini is updated to use latest django versions and the
  official trunk with python3 support;
- django 1.5 SimpleCookie issues are fixed.

1.5.3 (2012-04-25)
------------------

- self.assertRedirects is fixed for authenticated requests.

1.5.2 (2012-04-01)
------------------

- if AuthenticationMiddleware is not in a middleware list,
  WebtestUserMiddleware is put to the end of middlewares in order to
  provide better backward compatibility with 1.4.x in case of custom
  auth middlewares.

1.5.1 (2012-03-22)
------------------

- Fixed handling of forms with method="get". Thanks Jeroen Vloothuis.

1.5 (2012-02-24)
----------------

- WebtestUserMiddleware is inserted after AuthenticationMiddleware, not to
  the end of middleware list (thanks bigkevmcd);
- don't list python 2.5 as supported because WebOb dropped 2.5 support;
- python 3 support;
- test running using tox.

1.4.4 (2012-02-08)
------------------

- 'user' parameter for ``self.app.put`` and ``self.app.delete`` methods (thanks
  Ruslan Popov).

1.4.3 (2011-09-27)
------------------

- The django session dictionary is available via ``self.app.session``.

1.4.2 (2011-08-26)
------------------

- ``REMOTE_ADDR`` is now ``'127.0.0.1'`` by default. This is how
  standard django's test client behave.

  Please note that this can slow tests down and cause other side effects
  if django-debug-toolbar 0.9.x is installed+configured and
  ``INTERNAL_IPS`` contain ``'127.0.0.1'`` because debug toolbar will
  become turned on during tests. The workaround is to remove
  django-debug-toolbar middleware during tests in your test settings::

      DEBUG_MIDDLEWARE = 'debug_toolbar.middleware.DebugToolbarMiddleware'
      if DEBUG_MIDDLEWARE in MIDDLEWARE_CLASSES:
          MIDDLEWARE_CLASSES.remove(DEBUG_MIDDLEWARE)


1.4.1 (2011-06-29)
------------------

- ``self.renew_app()`` method for resetting the 'browser' inside tests.

1.4 (2011-06-23)
----------------

- Better auth implementation;
- support for assertRedirects, assertContains and assertNotContains.

1.3 (2010-12-31)
----------------

- Django 1.3 compatibility: test responses are now having 'templates' attribute;
- Django 1.3 compatibility: the way exceptions are handled is changed;
- auto_follow parameter for app.get method (redirect chains will be
  auto-followed with auto_follow=True).

1.2.1 (2010-08-24)
------------------

- REMOTE_USER authorization can be disabled.

1.2 (2010-08-21)
----------------

- ``response.template`` and ``response.context`` goodness (thanks Gregor Müllegger);
- tests (thanks Gregor Müllegger);
- csrf checks are now optional (thanks Gregor Müllegger).

1.1.1 (2010-07-16)
------------------

- User instance can be passed to `get` and `post` methods instead
  of user's username.

1.1 (2010-06-15)
----------------

- Original traceback instead of html 500 error page;
- per-TestCase extra_environ (thanks Gael Pasgrimaud);
- fixed a bug with app.post parameters (thanks anonymous).


1.0 (2010-04-20)
----------------
Initial release (thanks Ian Bicking for WebTest).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/django-webtest/django-webtest",
    "name": "django-webtest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django,webtest,pytest",
    "author": "Mikhail Korobov",
    "author_email": "kmike84@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f8/bf/beea8e547d9f134eed2832fe00811a57bced400592538d02689a8a956c6a/django-webtest-1.9.11.tar.gz",
    "platform": null,
    "description": "==============\ndjango-webtest\n==============\n\n.. image:: https://img.shields.io/pypi/v/django-webtest.svg\n   :target: https://pypi.python.org/pypi/django-webtest\n   :alt: PyPI Version\n\n.. image:: https://img.shields.io/github/license/kmike/django-webtest.svg\n   :target: https://github.com/django-webtest/django-webtest/blob/master/LICENSE.txt\n   :alt: License\n\n.. image:: https://img.shields.io/travis/django-webtest/django-webtest/master.svg\n   :target: http://travis-ci.org/django-webtest/django-webtest\n   :alt: Build Status\n\ndjango-webtest is an app for instant integration of Ian Bicking's\nWebTest (http://docs.pylonsproject.org/projects/webtest/) with Django's\ntesting framework.\n\nInstallation\n============\n\n.. code-block:: console\n\n    $ pip install django-webtest\n\nUsage\n=====\n\n.. code-block:: python\n\n    from django_webtest import WebTest\n\n    class MyTestCase(WebTest):\n\n        # optional: we want some initial data to be able to login\n        fixtures = ['users', 'blog_posts']\n\n        # optional: default extra_environ for this TestCase\n        extra_environ = {'HTTP_ACCEPT_LANGUAGE': 'ru'}\n\n        def testBlog(self):\n            # pretend to be logged in as user `kmike` and go to the index page\n            index = self.app.get('/', user='kmike')\n\n            # All the webtest API is available. For example, we click\n            # on a <a href='/tech-blog/'>Blog</a> link, check that it\n            # works (result page doesn't raise exceptions and returns 200 http\n            # code) and test if result page have 'My Article' text in\n            # its body.\n            assert 'My Article' in index.click('Blog')\n\ndjango-webtest provides a django.test.TestCase subclass\n(``django_webtest.WebTest``) that creates ``webtest.TestApp`` around\ndjango wsgi interface and makes it available in tests as ``self.app``.\n\nIt also features an optional ``user`` argument for ``self.app.get``,\n``self.app.post``, etc. to help making authorized requests. This argument\nshould be a django.contrib.auth.models.User instance or a string with user's\n``username`` for the user who is supposed to be logged in. To log out again,\ncall ``self.app.reset``, clearing all cookies.  To make a bunch of calls\nwith the same user, call ``app.set_user(user)`` before your requests; if\nyou want to disable that user, call ``app.get(..., user=None)`` for one\nrequest or ``app.set_user(None)`` to unset the user for all following calls.\n\nFor 500 errors original traceback is shown instead of usual html result\nfrom handler500.\n\nYou also get the ``response.templates`` and ``response.context`` goodness that\nis usually only available if you use Django's native test client. These\nattributes contain a list of templates that were used to render the response\nand the context used to render these templates. All of Django's native asserts (\n``assertFormError``,  ``assertTemplateUsed``, ``assertTemplateNotUsed``,\n``assertContains``, ``assertNotContains``, ``assertRedirects``) are\nalso supported for WebTest responses.\n\nThe session dictionary is available via ``self.app.session``, and has the\nsame content than Django's native test client.\n\nUnlike Django's native test client CSRF checks are not suppressed\nby default so missing CSRF tokens will cause test fails (and that's good).\n\nIf forms are submitted via WebTest forms API then all form fields (including\nCSRF token) are submitted automagically:\n\n.. code-block:: python\n\n    class AuthTest(WebTest):\n        fixtures = ['users.json']\n\n        def test_login(self):\n            form = self.app.get(reverse('auth_login')).form\n            form['username'] = 'foo'\n            form['password'] = 'bar'\n            response = form.submit().follow()\n            self.assertEqual(response.context['user'].username, 'foo')\n\nHowever if forms are submitted via raw POST requests using ``app.post`` then\ncsrf tokens become hard to construct. CSRF checks can be disabled by setting\n``csrf_checks`` attribute to False in this case:\n\n.. code-block:: python\n\n    class MyTestCase(WebTest):\n        csrf_checks = False\n\n        def test_post(self):\n            self.app.post('/')\n\nWhen a subclass of Django's ``TransactionTestCase`` is desired,\nuse ``django_webtest.TransactionWebTest``.\n\nFor disabling CSRF checks in a ``pytest-django`` fixture, see\n`Usage with PyTest`_.\n\nAll of these features can be easily set up manually (thanks to WebTest\narchitecture) and they are even not neccessary for using WebTest with Django but\nit is nice to have some sort of integration instantly.\n\nSee http://docs.pylonsproject.org/projects/webtest/ for API help. Webtest can\nfollow links, submit forms, parse html, xml and json responses with different\nparsing libraries, upload files and more.\n\nIntegration with django-rest-framework\n======================================\n\nIf your project uses django-rest-framework__, the setting\n``REST_FRAMEWORK['AUTHENTICATION_CLASSES']`` will be patched\nautomatically to include a class that links the rest-framework\nauthentication system with ``app.get(user=user)``.\n\n.. __: https://www.django-rest-framework.org/\n\nUsage with PyTest\n=================\n\nYou need to install `pytest-django <https://pytest-django.readthedocs.io>`_:\n\n.. code-block:: console\n\n    $ pip install pytest-django\n\nThen you can use ``django-webtest``'s fixtures:\n\n.. code-block:: python\n\n    def test_1(django_app):\n        resp = django_app.get('/')\n        assert resp.status_code == 200, 'Should return a 200 status code'\n\nWe have a ``django_app_factory`` fixture we can use to create custom fixtures.\nFor example, one that doesn't do CSRF checks:\n\n.. code-block:: python\n\n    # conftest.py\n\n    @pytest.fixture\n    def csrf_exempt_django_app(django_app_factory):\n        return django_app_factory(csrf_checks=False)\n\n``csrf_checks`` and ``extra_environ`` are the only arguments to\n``django_app_factory``.\n\n\nWhy?\n====\n\nWhile django.test.client.Client is fine for its purposes, it is not\nwell-suited for functional or integration testing. From Django's test client\ndocstring:\n\n    This is not intended as a replacement for Twill/Selenium or\n    the like - it is here to allow testing against the\n    contexts and templates produced by a view, rather than the\n    HTML rendered to the end-user.\n\nWebTest plays on the same field as twill. WebTest has a nice API,\nis fast, small, talks to the django application via WSGI instead of HTTP\nand is an easy way to write functional/integration/acceptance tests.\ndjango-webtest is able to provide access to the names of rendered templates\nand template context just like native Django TestClient.\n\nContributing\n============\n\nDevelopment happens at github: https://github.com/django-webtest/django-webtest\nIssue tracker: https://github.com/django-webtest/django-webtest/issues\n\nFeel free to submit ideas, bugs or pull requests.\n\nRunning tests\n-------------\n\nMake sure `tox`_ is installed and run:\n\n.. code-block:: console\n\n    $ tox\n\nfrom the source checkout.\n\n.. _tox: http://tox.testrun.org\n\n\n\nCHANGES\n=======\n\n1.9.11 (2023-09-18)\n-------------------\n\n- Add support for official Python & Django versions\n\n- Do not insert  WebtestAuthentication to the head of DEFAULT_AUTHENTICATION_CLASSES.\n\n1.9.10 (2022-03-02)\n-------------------\n\n- Add an optional WebTest backend that does not interfere with handling of permissions by\n  custom backends. Accessible via WEBTEST_AUTHENTICATION_BACKEND setting. Fixed #123\n\n\n1.9.9 (2021-12-27)\n------------------\n\n- Add Django 4 support\n\n- Remove Django 2 support\n\n\n1.9.8 (2021-10-06)\n------------------\n\n- Update testing configurations for Django and Python as per Django documentation\n    - https://docs.djangoproject.com/en/3.0/faq/install/#what-python-version-can-i-use-with-django\n\n- Add some useful metadata for the project's PyPI listing\n\n- Minor changes to documentation\n\n- Update getting session in DjangoTestApp.  Fixed #113\n\n- Remove py27/py35 support\n\n\n1.9.7 (2019-07-05)\n------------------\n\n- allow overriding HTTP_HOST with DjangoTestApp.__init__. Fixed #102\n\n\n1.9.6 (2019-06-07)\n------------------\n\n- rest_framework auth class. Fixed #98 #100\n\n\n1.9.5 (2019-05-31)\n------------------\n\n- Fix compatibility with django 3. See #96\n\n- Add integration with django-rest-framework auth\n\n- Add missing args to DjangoTestApp. Fixed #86\n\n\n1.9.4 (2018-10-27)\n------------------\n\n- py34 and Django 1.8 are no longer tested (but may works)\n\n- allow to use positionnal args; fixed #89\n\n- remove deprecated pytest.yield_fixture functions. use pytest.fixture instead;\n  fixed #88\n\n- Don't add duplicate WebtestUserMiddleware to the list of middlewares in\n  WebTestMixin. fixed #87\n\n- restore MIDDLEWARE_CLASSES support; fixed #84\n\n\n1.9.3 (2018-05-03)\n------------------\n\n- Passing `user=None` to get/post/etc. methods will clear a user\n  previously set with `set_user` instead of doing nothing.\n\n- Avoid sharing settings between tests in pytest plugin\n\n- Fix middleware settings name used\n\n\n1.9.2 (2017-05-17)\n------------------\n\n- silence warnings about is_authenticated on 1.11\n\n- include correct hostname (testserver) when using set_cookie\n\n\n1.9.1 (2017-03-09)\n------------------\n\n- Fix package description (multiline are no longer allowed by pypi)\n\n\n1.9.0 (2017-03-09)\n------------------\n\n- Backward incompatibility: positionnal arguments are no longer supported.\n  You'll need to replace them by keywords arguments.\n\n- Added support for Django 1.11\n\n- Dropped support for Django <= 1.7\n\n- Dropped support for Python 2.6\n\n- Changed value of `HTTP_HOST` header from `localhost` to `testserver`, to\n  match behaviour of Django test client.\n\n- Fixed `DjangoTestApp.options`\n\n- Added `DjangoTestApp.head`\n\n- Added pytest fixtures\n\n\n1.8.0 (2016-09-14)\n------------------\n\n- Fixed issue #40 - combining ``app.get`` ``auto_follow=True`` with other\n  keyword args.\n\n- Add compatibility to the MIDDLEWARE setting introduced in django 1.10\n\n- Drop support for django 1.2\n\n1.7.9 (2016-04-19)\n------------------\n\n- Add set_user() to allow to set a user globally for the app\n\n- Allow 'click' to be given a user param\n\n- Mention testapp.reset() in readme\n\n- Allow to use ``json_`` methods\n\n1.7.8 (2015-04-21)\n------------------\n\n- setup.py is switched to setuptools; WebTest is now installed automatically\n  (thanks Eric Araujo);\n- importlib from stdlib is used when available, for django 1.9 compatibility\n  (thanks Helen Sherwood-Taylor);\n- django-webtest's own tests are fixed to work in django 1.6+;\n- https://bitbucket.org/kmike/django-webtest repository is no longer supported.\n\n1.7.7 (2014-03-25)\n------------------\n\n- Fix installation for Python 3.x on systems with C locales.\n\n1.7.6 (2014-01-20)\n------------------\n\n- DjangoTestApp methods pass all custom keyword arguments to webtest.TestApp;\n  this allows to use ``xhr=True`` feature (thanks Max Kharandziuk).\n- Travis CI testing fixes (thanks Darian Moody).\n\n1.7.5 (2013-07-17)\n------------------\n\n- OPTIONS method is fixed;\n- added workaround for DELETE method warnings\n  (see https://github.com/Pylons/webtest/issues/50).\n\n1.7.4 (2013-07-14)\n------------------\n\n- Really add ``TransactionWebTest`` base class (thanks Julien Aubert).\n\n1.7.3 (2013-07-07)\n------------------\n\n- Added support for PATCH and OPTIONS HTTP methods (thanks Will Bradley).\n\n1.7.2 (2013-06-27)\n------------------\n\n- ``TransactionWebTest`` base class is added (thanks Iurii Kriachko).\n\n1.7.1 (2013-06-11)\n------------------\n\n- Added support for non-ascii usernames.\n\n1.7 (2013-05-23)\n----------------\n\n- Added support for django 1.6 (thanks Carl Meyer).\n\n1.6.1 (2013-03-31)\n------------------\n\n- Added support for django 1.5+ custom user models (thanks Gautier Hayoun).\n\n1.6 (2013-03-07)\n----------------\n\n- Added ability to pass a custom response_class and app_class to WebTest\n  (thanks Bruno Reni\u00e9);\n- Added case-insensitive header access in DjangoWebtestResponse (thanks\n  Bruno Reni\u00e9).\n\n1.5.7 (2013-02-27)\n------------------\n\n- WebTest 2.0 support.\n\n1.5.6 (2013-01-21)\n------------------\n\n- django 1.5 support: transaction handling is fixed (thanks Marco Braak).\n\n1.5.5 (2013-01-14)\n------------------\n\n- Fixed django 1.5 support: DjangoWebtestResponse.streaming attribute\n  is added (thanks David Winterbottom).\n\n1.5.4 (2012-09-13)\n------------------\n\n- fix django 1.5 issues with AdminMediaHandler (thanks Tai Lee);\n- tox.ini is updated to use latest django versions and the\n  official trunk with python3 support;\n- django 1.5 SimpleCookie issues are fixed.\n\n1.5.3 (2012-04-25)\n------------------\n\n- self.assertRedirects is fixed for authenticated requests.\n\n1.5.2 (2012-04-01)\n------------------\n\n- if AuthenticationMiddleware is not in a middleware list,\n  WebtestUserMiddleware is put to the end of middlewares in order to\n  provide better backward compatibility with 1.4.x in case of custom\n  auth middlewares.\n\n1.5.1 (2012-03-22)\n------------------\n\n- Fixed handling of forms with method=\"get\". Thanks Jeroen Vloothuis.\n\n1.5 (2012-02-24)\n----------------\n\n- WebtestUserMiddleware is inserted after AuthenticationMiddleware, not to\n  the end of middleware list (thanks bigkevmcd);\n- don't list python 2.5 as supported because WebOb dropped 2.5 support;\n- python 3 support;\n- test running using tox.\n\n1.4.4 (2012-02-08)\n------------------\n\n- 'user' parameter for ``self.app.put`` and ``self.app.delete`` methods (thanks\n  Ruslan Popov).\n\n1.4.3 (2011-09-27)\n------------------\n\n- The django session dictionary is available via ``self.app.session``.\n\n1.4.2 (2011-08-26)\n------------------\n\n- ``REMOTE_ADDR`` is now ``'127.0.0.1'`` by default. This is how\n  standard django's test client behave.\n\n  Please note that this can slow tests down and cause other side effects\n  if django-debug-toolbar 0.9.x is installed+configured and\n  ``INTERNAL_IPS`` contain ``'127.0.0.1'`` because debug toolbar will\n  become turned on during tests. The workaround is to remove\n  django-debug-toolbar middleware during tests in your test settings::\n\n      DEBUG_MIDDLEWARE = 'debug_toolbar.middleware.DebugToolbarMiddleware'\n      if DEBUG_MIDDLEWARE in MIDDLEWARE_CLASSES:\n          MIDDLEWARE_CLASSES.remove(DEBUG_MIDDLEWARE)\n\n\n1.4.1 (2011-06-29)\n------------------\n\n- ``self.renew_app()`` method for resetting the 'browser' inside tests.\n\n1.4 (2011-06-23)\n----------------\n\n- Better auth implementation;\n- support for assertRedirects, assertContains and assertNotContains.\n\n1.3 (2010-12-31)\n----------------\n\n- Django 1.3 compatibility: test responses are now having 'templates' attribute;\n- Django 1.3 compatibility: the way exceptions are handled is changed;\n- auto_follow parameter for app.get method (redirect chains will be\n  auto-followed with auto_follow=True).\n\n1.2.1 (2010-08-24)\n------------------\n\n- REMOTE_USER authorization can be disabled.\n\n1.2 (2010-08-21)\n----------------\n\n- ``response.template`` and ``response.context`` goodness (thanks Gregor M\u00fcllegger);\n- tests (thanks Gregor M\u00fcllegger);\n- csrf checks are now optional (thanks Gregor M\u00fcllegger).\n\n1.1.1 (2010-07-16)\n------------------\n\n- User instance can be passed to `get` and `post` methods instead\n  of user's username.\n\n1.1 (2010-06-15)\n----------------\n\n- Original traceback instead of html 500 error page;\n- per-TestCase extra_environ (thanks Gael Pasgrimaud);\n- fixed a bug with app.post parameters (thanks anonymous).\n\n\n1.0 (2010-04-20)\n----------------\nInitial release (thanks Ian Bicking for WebTest).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Instant integration of Ian Bicking's WebTest (http://docs.pylonsproject.org/projects/webtest/) with Django's testing framework.",
    "version": "1.9.11",
    "project_urls": {
        "Changelog": "https://github.com/django-webtest/django-webtest/blob/master/CHANGES.rst",
        "Code": "https://github.com/django-webtest/django-webtest",
        "Homepage": "https://github.com/django-webtest/django-webtest",
        "Issue Tracker": "https://github.com/django-webtest/django-webtest/issues"
    },
    "split_keywords": [
        "django",
        "webtest",
        "pytest"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb2eadab5fdb7562a4e831187b56f901cc2b1a35162eab92af2a307b74c69a50",
                "md5": "20be0a49af7b051f32bea810e7a7cf97",
                "sha256": "e29baf8337e7fe7db41ce63ca6661f7b5c77fe56f506f48b305e09313f5475b4"
            },
            "downloads": -1,
            "filename": "django_webtest-1.9.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "20be0a49af7b051f32bea810e7a7cf97",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16546,
            "upload_time": "2023-09-18T18:22:54",
            "upload_time_iso_8601": "2023-09-18T18:22:54.842220Z",
            "url": "https://files.pythonhosted.org/packages/fb/2e/adab5fdb7562a4e831187b56f901cc2b1a35162eab92af2a307b74c69a50/django_webtest-1.9.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8bfbeea8e547d9f134eed2832fe00811a57bced400592538d02689a8a956c6a",
                "md5": "31a7273bc8d88b1129d11bd6c5f6c75b",
                "sha256": "9597d26ced599bc5d4d9366bb451469fc9707b4779f79543cdf401ae6c5aeb35"
            },
            "downloads": -1,
            "filename": "django-webtest-1.9.11.tar.gz",
            "has_sig": false,
            "md5_digest": "31a7273bc8d88b1129d11bd6c5f6c75b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28576,
            "upload_time": "2023-09-18T18:22:57",
            "upload_time_iso_8601": "2023-09-18T18:22:57.271914Z",
            "url": "https://files.pythonhosted.org/packages/f8/bf/beea8e547d9f134eed2832fe00811a57bced400592538d02689a8a956c6a/django-webtest-1.9.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-18 18:22:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "django-webtest",
    "github_project": "django-webtest",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-webtest"
}
        
Elapsed time: 0.71858s