Skip to main content

Utility classes for testing Django views that speak XML-RPC

Project description

https://secure.travis-ci.org/msabramo/djangotestxmlrpc.png?branch=master

Test Django XML-RPC views using the Django test client. Because you’re using the Django test client, you’re not actually sending HTTP requests and don’t need a server running.

This is a slightly modified version of code taken from this blog post from Forest Bond.

Example usage:

from djangotestxmlrpc import DjangoTestClientXMLRPCTransport

class TestXmlRpc(django.test.TestCase):
    ...

    def test_list_package(self):
        pypi = xmlrpclib.ServerProxy(
            "http://localhost/pypi/",
            transport=DjangoTestClientXMLRPCTransport(self.client))
        pypi_hits = pypi.list_packages()
        expected = ['foo']
        self.assertEqual(pypi_hits, expected)

Supported Python versions

  • Python 2.5

  • Python 2.6

  • Python 2.7

  • PyPy 1.9

  • Python 3.1

  • Python 3.2

  • Python 3.3

or says tox:

~/dev/git-repos/djangotestxmlrpc$ tox
...
  py25: commands succeeded
  py26: commands succeeded
  py27: commands succeeded
  pypy: commands succeeded
  py31: commands succeeded
  py32: commands succeeded
  py33: commands succeeded
  congratulations :)

You also can check the latest Travis CI results, but Travis doesn’t build all of the above platforms.

Issues

Send your bug reports and feature requests to https://github.com/msabramo/djangotestxmlrpc/issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangotestxmlrpc-0.0.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file djangotestxmlrpc-0.0.2.tar.gz.

File metadata

File hashes

Hashes for djangotestxmlrpc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 98f46c090a0762e84f05e7eaf84c2699d59ed7f50dfac2abebd19124aba5835b
MD5 c0fb9b6935f88547c91aeeaf9fe3c5a0
BLAKE2b-256 fbcfd351d4a576513ba6fae63a5e471d9302abd6a5df6719abe9f8e85910a00b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page