diff mbox

[Branch,~linaro-validation/lava-scheduler/trunk] Rev 12: use ubertestcase

Message ID 20110706224229.3582.5138.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson July 6, 2011, 10:42 p.m. UTC
------------------------------------------------------------
revno: 12
committer: Michael-Doyle Hudson <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Thu 2011-07-07 10:26:43 +1200
message:
  use ubertestcase
modified:
  lava_scheduler_app/tests.py
  setup.py


--
lp:lava-scheduler
https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk

You are subscribed to branch lp:lava-scheduler.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_scheduler_app/tests.py'
--- lava_scheduler_app/tests.py	2011-06-23 04:08:49 +0000
+++ lava_scheduler_app/tests.py	2011-07-06 22:26:43 +0000
@@ -1,20 +1,19 @@ 
+import cStringIO
 import datetime
 import json
 import xmlrpclib
 
 from django.contrib.auth.models import Permission, User
-from django.test import TestCase
+from django.test.client import Client
+
+from django_testscenarios.ubertest import TestCase
 
 from lava_scheduler_app.models import Device, DeviceType, TestJob
 
-import cStringIO
-
-from xmlrpclib import ServerProxy, Transport
-
-from django.test.client import Client
+
 
 # Based on http://www.technobabble.dk/2008/apr/02/xml-rpc-dispatching-through-django-test-client/
-class TestTransport(Transport):
+class TestTransport(xmlrpclib.Transport):
     """Handles connections to XML-RPC server through Django test client."""
 
     def __init__(self, user=None, password=None):
@@ -138,7 +137,7 @@ 
 class TestSchedulerAPI(TestCaseWithFactory):
 
     def server_proxy(self, user=None, password=None):
-        return ServerProxy(
+        return xmlrpclib.ServerProxy(
             'http://localhost/RPC2/',
             transport=TestTransport(user=user, password=password))
 

=== modified file 'setup.py'
--- setup.py	2011-07-06 22:00:53 +0000
+++ setup.py	2011-07-06 22:26:43 +0000
@@ -38,6 +38,10 @@ 
         "twisted",
         ],
     setup_requires=[
-        "versiontools >= 1.3.1"],
+        "versiontools >= 1.3.1",
+        ],
+    test_requires=[
+        "django-testscenarios",
+        ],
     zip_safe=False,
     include_package_data=True)