WebTest 1.2.1 - Testing Web Application with Python

WebTest helps you test your WSGI-based web applications. This can be any application that has a WSGI interface, including an application written in a framework that supports WSGI (which includes most actively developed Python web frameworks – almost anything that even nominally supports WSGI should be testable).

With this you can test your web applications without starting an HTTP server, and without poking into the web framework shortcutting pieces of your application that need to be tested. The tests WebTest runs are entirely equivalent to how a WSGI HTTP server would call an application. By testing the full stack of your application, the WebTest testing model is sometimes called a functional test, integration test, or acceptance test (though the latter two are not particularly good descriptions). This is in contrast to a unit test which tests a particular piece of functionality in your application. While complex programming tasks are often is suited to unit tests, template logic and simple web programming is often best done with functional tests; and regardless of the presence of unit tests, no testing strategy is complete without high-level tests to ensure the entire programming system works together.

WebTest helps you create tests by providing a convenient interface to run WSGI applications and verify the output.

Version 1.2.1

  • Added method :method:`TestApp.request`, which can be used for sending requests with different methods (e.g., MKCOL). This method sends all its keyword arguments to :method:`webtest.TestRequest.blank` and then executes the request. The parameters are somewhat different than other methods (like :method:`webtest.TestApp.get`), as they match WebOb’s attribute names exactly (the other methods were written before WebOb existed).
  • Removed the copying of stdout to stderr during requests.
  • Fix file upload fields in forms (#340) – you could upload files with :method:`webtest.TestApp.post`, but if you use resp.form file upload fields would not work (from rcs-comp.com and Matthew Desmarais).

More information: here

Compliance Mandates

  • Code Auditing :

    PCI/DSS 6.3.6, 6.3.7, 6.6, SOX A12.8, GLBA 16CFR Part 314.4(b) and (2);FISMA RA-5, SC-18, SA-11 SI-2, and ISO 27001/27002 (12.4.1, 12.4.3, 12.5)


Related Articles

Code Auditing
Configurations checks