diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tests.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 6975ac1bfe..eebd1b79ba 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
@@ -493,80 +493,6 @@ class ViewTests(TestCase): | |||
493 | "Changed page on table %s but first row is the " | 493 | "Changed page on table %s but first row is the " |
494 | "same as the previous page" % name) | 494 | "same as the previous page" % name) |
495 | 495 | ||
496 | class LandingPageTests(TestCase): | ||
497 | """ Tests for redirects on the landing page """ | ||
498 | # disable bogus pylint message error: | ||
499 | # "Instance of 'WSGIRequest' has no 'url' member (no-member)" | ||
500 | # (see https://github.com/landscapeio/pylint-django/issues/42) | ||
501 | # pylint: disable=E1103 | ||
502 | |||
503 | LANDING_PAGE_TITLE = 'This is Toaster' | ||
504 | |||
505 | def setUp(self): | ||
506 | """ Add default project manually """ | ||
507 | self.project = Project.objects.create_project('foo', None) | ||
508 | self.project.is_default = True | ||
509 | self.project.save() | ||
510 | |||
511 | def test_only_default_project(self): | ||
512 | """ | ||
513 | No projects except default | ||
514 | => get the landing page | ||
515 | """ | ||
516 | response = self.client.get(reverse('landing')) | ||
517 | self.assertTrue(self.LANDING_PAGE_TITLE in response.content) | ||
518 | |||
519 | def test_default_project_has_build(self): | ||
520 | """ | ||
521 | Default project has a build, no other projects | ||
522 | => get the builds page | ||
523 | """ | ||
524 | now = timezone.now() | ||
525 | build = Build.objects.create(project=self.project, | ||
526 | started_on=now, | ||
527 | completed_on=now) | ||
528 | build.save() | ||
529 | |||
530 | response = self.client.get(reverse('landing')) | ||
531 | self.assertEqual(response.status_code, 302, | ||
532 | 'response should be a redirect') | ||
533 | self.assertTrue('/builds' in response.url, | ||
534 | 'should redirect to builds') | ||
535 | |||
536 | def test_user_project_exists(self): | ||
537 | """ | ||
538 | User has added a project (without builds) | ||
539 | => get the projects page | ||
540 | """ | ||
541 | user_project = Project.objects.create_project('foo', None) | ||
542 | user_project.save() | ||
543 | |||
544 | response = self.client.get(reverse('landing')) | ||
545 | self.assertEqual(response.status_code, 302, | ||
546 | 'response should be a redirect') | ||
547 | self.assertTrue('/projects' in response.url, | ||
548 | 'should redirect to projects') | ||
549 | |||
550 | def test_user_project_has_build(self): | ||
551 | """ | ||
552 | User has added a project (with builds) | ||
553 | => get the builds page | ||
554 | """ | ||
555 | user_project = Project.objects.create_project('foo', None) | ||
556 | user_project.save() | ||
557 | |||
558 | now = timezone.now() | ||
559 | build = Build.objects.create(project=user_project, | ||
560 | started_on=now, | ||
561 | completed_on=now) | ||
562 | build.save() | ||
563 | |||
564 | response = self.client.get(reverse('landing')) | ||
565 | self.assertEqual(response.status_code, 302, | ||
566 | 'response should be a redirect') | ||
567 | self.assertTrue('/builds' in response.url, | ||
568 | 'should redirect to builds') | ||
569 | |||
570 | class BuildDashboardTests(TestCase): | 496 | class BuildDashboardTests(TestCase): |
571 | """ Tests for the build dashboard /build/X """ | 497 | """ Tests for the build dashboard /build/X """ |
572 | 498 | ||