diff options
| author | Elliot Smith <elliot.smith@intel.com> | 2015-10-14 15:43:45 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-16 14:13:22 +0100 |
| commit | 069a611097265c0100582dfb69dfdddbc08a31fc (patch) | |
| tree | f57d0085976cad5efe79db559f78906dd080949f /bitbake/lib/toaster/toastergui/tests.py | |
| parent | 026e9812648e9d43b3fcfce8aab1cd8e843246a2 (diff) | |
| download | poky-069a611097265c0100582dfb69dfdddbc08a31fc.tar.gz | |
bitbake: 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]
(Bitbake rev: 8795667d03bd8705d7e13c5d3d6bb6da371fa91d)
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>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tests.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 95790a2bb8..e652b987a6 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
| @@ -574,3 +574,33 @@ class ProjectBuildsDisplayTest(TestCase): | |||
| 574 | response = self.client.get(url, follow=True) | 574 | response = self.client.get(url, follow=True) |
| 575 | result = re.findall('bash:clean', response.content, re.MULTILINE) | 575 | result = re.findall('bash:clean', response.content, re.MULTILINE) |
| 576 | self.assertEqual(len(result), 3) | 576 | self.assertEqual(len(result), 3) |
| 577 | |||
| 578 | class ProjectPageTests(TestCase): | ||
| 579 | """ Test project data at /project/X/ is displayed correctly """ | ||
| 580 | CLI_BUILDS_PROJECT_NAME = 'Command line builds' | ||
| 581 | |||
| 582 | def test_command_line_builds_in_progress(self): | ||
| 583 | """ | ||
| 584 | In progress builds should not cause an error to be thrown | ||
| 585 | when navigating to "command line builds" project page; | ||
| 586 | see https://bugzilla.yoctoproject.org/show_bug.cgi?id=8277 | ||
| 587 | """ | ||
| 588 | |||
| 589 | # add the "command line builds" default project; this mirrors what | ||
| 590 | # we do in migration 0026_set_default_project.py | ||
| 591 | default_project = Project.objects.create_project(self.CLI_BUILDS_PROJECT_NAME, None) | ||
| 592 | default_project.is_default = True | ||
| 593 | default_project.save() | ||
| 594 | |||
| 595 | # add an "in progress" build for the default project | ||
| 596 | now = timezone.now() | ||
| 597 | build = Build.objects.create(project=default_project, | ||
| 598 | started_on=now, | ||
| 599 | completed_on=now, | ||
| 600 | outcome=Build.IN_PROGRESS) | ||
| 601 | |||
| 602 | # navigate to the project page for the default project | ||
| 603 | url = reverse("project", args=(default_project.id,)) | ||
| 604 | response = self.client.get(url, follow=True) | ||
| 605 | |||
| 606 | self.assertEqual(response.status_code, 200) | ||
