diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 335: fix the tests

Message ID 20120829235110.11125.95572.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Aug. 29, 2012, 11:51 p.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-dashboard/fix-tests/+merge/121525
  proposed by: Michael Hudson-Doyle (mwhudson)
------------------------------------------------------------
revno: 335 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Thu 2012-08-30 11:50:42 +1200
message:
  fix the tests
modified:
  dashboard_app/helpers.py
  dashboard_app/tests/other/csrf.py
  dashboard_app/tests/other/deserialization.py
  dashboard_app/tests/other/login.py
  dashboard_app/tests/views/bundle_stream_list_view.py
  setup.py


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

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

Patch

=== modified file 'dashboard_app/helpers.py'
--- dashboard_app/helpers.py	2011-09-28 02:29:55 +0000
+++ dashboard_app/helpers.py	2012-08-28 00:04:26 +0000
@@ -12,7 +12,7 @@ 
 from linaro_dashboard_bundle.errors import DocumentFormatError
 from linaro_dashboard_bundle.evolution import DocumentEvolution
 from linaro_dashboard_bundle.io import DocumentIO
-from linaro_json.extensions import datetime_extension, timedelta_extension
+from json_schema_validator.extensions import datetime_extension, timedelta_extension
 
 
 PROFILE_LOGGING = False
@@ -729,7 +729,7 @@ 
             be quite safe though as it passes all tests.
 
         :Exceptions raised:
-            linaro_json.ValidationError
+            json_schema_validator.ValidationError
                 When the document does not match the appropriate schema.
             linaro_dashboard_bundle.errors.DocumentFormatError
                 When the document format is not in the known set of formats.

=== modified file 'dashboard_app/tests/other/csrf.py'
--- dashboard_app/tests/other/csrf.py	2011-07-13 12:48:21 +0000
+++ dashboard_app/tests/other/csrf.py	2012-08-28 01:45:04 +0000
@@ -29,7 +29,7 @@ 
 from django.template import Template, RequestContext
 
 from dashboard_app.tests.utils import CSRFTestCase
-from dashboard_app import urls
+from lava_server import urls
 
 
 class CSRFConfigurationTestCase(CSRFTestCase):

=== modified file 'dashboard_app/tests/other/deserialization.py'
--- dashboard_app/tests/other/deserialization.py	2011-09-27 06:52:52 +0000
+++ dashboard_app/tests/other/deserialization.py	2012-08-28 02:21:41 +0000
@@ -29,8 +29,8 @@ 
 )
 from django.contrib.auth.models import User
 from linaro_dashboard_bundle.errors import DocumentFormatError
-from linaro_json.schema import ValidationError
-from linaro_json.extensions import datetime_extension
+from json_schema_validator.errors import ValidationError
+from json_schema_validator.extensions import datetime_extension
 
 
 from dashboard_app.tests import fixtures
@@ -728,15 +728,20 @@ 
 
     def test_error_trace(self):
         self.s_bundle.deserialize()
-        # The message depends on the database. This is a little ugly but it's
-        # better than not knowing what really happened and hiding other
-        # potential bugs that would otherwise be masked here.
+        # The message depends on the database -- even the version of the
+        # database.  This is a little ugly but it's better than not knowing
+        # what really happened and hiding other potential bugs that would
+        # otherwise be masked here.
+        error_message = self.s_bundle.deserialization_error.error_message
+        error_first_line = error_message.splitlines()[0].strip()
         self.assertIn(
-            self.s_bundle.deserialization_error.error_message, [
+            error_first_line,
+            [
                 'A test with UUID 1ab86b36-c23d-11df-a81b-002163936223 already exists',
                 'column analyzer_assigned_uuid is not unique',
                 u'duplicate key value violates unique constraint '
-                u'"dashboard_app_testrun_analyzer_assigned_uuid_key"\n'])
+                '"dashboard_app_testrun_analyzer_assigned_uuid_key"',
+                ])
 
     def test_deserialization_failure_does_not_leave_junk_behind(self):
         self.s_bundle.deserialize()

=== modified file 'dashboard_app/tests/other/login.py'
--- dashboard_app/tests/other/login.py	2010-10-15 20:09:24 +0000
+++ dashboard_app/tests/other/login.py	2012-08-28 01:45:04 +0000
@@ -28,15 +28,19 @@ 
 
 from django_openid_auth.models import UserOpenID
 from django_openid_auth.tests.test_views import StubOpenIDProvider
+import django_openid_auth.tests.urls
 
 from openid.fetchers import setDefaultFetcher
 
 from dashboard_app.tests.utils import TestClient
 
+import lava_server.urls
 
 class TestOpenIDLogin(TestCase):
 
-    urls = 'django_openid_auth.tests.urls'
+    urls = tuple(
+        django_openid_auth.tests.urls.urlpatterns
+        + lava_server.urls.urlpatterns)
     _username = 'someuser'
     _identity_url = 'http://example.com/identity'
 

=== modified file 'dashboard_app/tests/views/bundle_stream_list_view.py'
--- dashboard_app/tests/views/bundle_stream_list_view.py	2011-05-30 16:13:38 +0000
+++ dashboard_app/tests/views/bundle_stream_list_view.py	2012-08-28 00:43:11 +0000
@@ -79,7 +79,7 @@ 
                         bundle_stream.is_accessible_by(self.user)])
             effective_bsl = sorted(
                     [bundle_stream.pk for bundle_stream in
-                        response.context['bundle_stream_list']])
+                        response.context['bundle_stream_table'].data.queryset])
             self.assertEqual(effective_bsl, expected_bsl)
 
 

=== modified file 'setup.py'
--- setup.py	2011-12-05 21:43:17 +0000
+++ setup.py	2012-08-28 00:05:01 +0000
@@ -55,7 +55,6 @@ 
         'linaro-dashboard-bundle >= 1.5.2',
         'linaro-django-pagination >= 2.0.2',
         'linaro-django-xmlrpc >= 0.4',
-        'linaro-json >= 2.0.1',  # TODO: use json-schema-validator
         'pygments >= 1.2',
         'south >= 0.7.3',
         'versiontools >= 1.8',