summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-03-31 19:55:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-01 07:14:59 +0100
commit7dcb4c41272e8f611eabea991fa30df79b9e48e3 (patch)
tree6574ec36d7befef5a981cd9a7868f668d5a9bbdb /bitbake/lib/toaster/toastergui
parent5b848fa7276dea302f392ac76f009c9353060166 (diff)
downloadpoky-7dcb4c41272e8f611eabea991fa30df79b9e48e3.tar.gz
bitbake: toaster: tests Migrate landing page tests to Selenium
(Bitbake rev: 20ce1e1b39a9b602eb51ca0ba3954ea3e999c874) 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')
-rw-r--r--bitbake/lib/toaster/toastergui/tests.py74
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
496class 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
570class BuildDashboardTests(TestCase): 496class BuildDashboardTests(TestCase):
571 """ Tests for the build dashboard /build/X """ 497 """ Tests for the build dashboard /build/X """
572 498