Utility classes for testing Django views that speak XML-RPC
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.
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
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.
Send your bug reports and feature requests to https://github.com/msabramo/djangotestxmlrpc/issues
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
djangotestxmlrpc-0.0.2.tar.gz (2.8 kB view hashes)