summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-14 15:43:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:06:04 +0100
commit8795667d03bd8705d7e13c5d3d6bb6da371fa91d (patch)
treebaa67eacf95f35dc0cb32c1fc692473f933e11c0
parentaf33409612139ab2347baf6b847b23faea19752d (diff)
downloadbitbake-8795667d03bd8705d7e13c5d3d6bb6da371fa91d.tar.gz
toaster: Test that exception isn't thrown by project page
Add a test which checks that an exception is no longer thrown for the /toastergui/project/X page for the default project. Note that we still get a spinning dialogue box on this page because the default project has no configuration to display, but at least it doesn't fail altogether. [YOCTO #8277] Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/toastergui/tests.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/tests.py b/lib/toaster/toastergui/tests.py
index 95790a2bb..e652b987a 100644
--- a/lib/toaster/toastergui/tests.py
+++ b/lib/toaster/toastergui/tests.py
@@ -574,3 +574,33 @@ class ProjectBuildsDisplayTest(TestCase):
response = self.client.get(url, follow=True)
result = re.findall('bash:clean', response.content, re.MULTILINE)
self.assertEqual(len(result), 3)
+
+class ProjectPageTests(TestCase):
+ """ Test project data at /project/X/ is displayed correctly """
+ CLI_BUILDS_PROJECT_NAME = 'Command line builds'
+
+ def test_command_line_builds_in_progress(self):
+ """
+ In progress builds should not cause an error to be thrown
+ when navigating to "command line builds" project page;
+ see https://bugzilla.yoctoproject.org/show_bug.cgi?id=8277
+ """
+
+ # add the "command line builds" default project; this mirrors what
+ # we do in migration 0026_set_default_project.py
+ default_project = Project.objects.create_project(self.CLI_BUILDS_PROJECT_NAME, None)
+ default_project.is_default = True
+ default_project.save()
+
+ # add an "in progress" build for the default project
+ now = timezone.now()
+ build = Build.objects.create(project=default_project,
+ started_on=now,
+ completed_on=now,
+ outcome=Build.IN_PROGRESS)
+
+ # navigate to the project page for the default project
+ url = reverse("project", args=(default_project.id,))
+ response = self.client.get(url, follow=True)
+
+ self.assertEqual(response.status_code, 200)