From patchwork Wed Aug 29 23:51:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 11032 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9EB2123E52 for ; Wed, 29 Aug 2012 23:51:14 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 87665A18345 for ; Wed, 29 Aug 2012 23:50:40 +0000 (UTC) Received: by iafj25 with SMTP id j25so2036587iaf.11 for ; Wed, 29 Aug 2012 16:51:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=R8j37P4RWYxgDOuJ8/2r+KGyH7jRcaopwV611VveEyc=; b=QPm+KVdKZbNFuLduqkHIqcULvsNxzRcZL2VsS8MnghnHqzH2lNaGKpLSC8i0zAO8Ug wiy1vJTTI5S/oGgWGPblj4S3WQrAJ5xaZKBbPcI4Up4oEbQ0YyYKPzcrSLd8FBCR/LYB x50XlRjg6wS81yMk0RbCiSCaEcom9+nvVQfI9rMaCb7dedhGsbMQbwa1Z/obXiGZA2aX qDE0vLrjMao4k4yzTHg2CyFILi2QxTW0C6tC/ND7hSduixrGBmp9COXC1ZVtWS78DriB SKH+n0g/tcOG4WksmmQRI34Gj3x3H9waSMQDpT/U2bpx7B+J5Vd9RyU9WdbczZj3y+MJ mc4Q== Received: by 10.50.10.201 with SMTP id k9mr3663974igb.28.1346284273584; Wed, 29 Aug 2012 16:51:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp113255igc; Wed, 29 Aug 2012 16:51:12 -0700 (PDT) Received: by 10.216.42.65 with SMTP id i43mr1832965web.208.1346284271951; Wed, 29 Aug 2012 16:51:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id p3si87811wea.45.2012.08.29.16.51.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Aug 2012 16:51:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1T6s2Q-0005pV-Gq for ; Wed, 29 Aug 2012 23:51:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 6F58BE01D2 for ; Wed, 29 Aug 2012 23:51:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 335 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 335: fix the tests Message-Id: <20120829235110.11125.95572.launchpad@ackee.canonical.com> Date: Wed, 29 Aug 2012 23:51:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15864"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 9e270aecd72453748007191b902a57689081ab6a X-Gm-Message-State: ALoCoQn1KIz9J3S6vOqonh8EwKSb3NZzHA7SQQKjjEnK5ZInXrqqeiif3VR0NhohTdR2r7s7ejsd 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 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 === 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',