add nick
[laas.git] / src / dashboard / tests / test_views.py
1 ##############################################################################
2 # Copyright (c) 2020 Parker Berberian, Sawyer Bergeron, and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 from django.test import TestCase, Client
11 from dashboard.testing_utils import make_lab
12
13
14 class DashboardViewTestCase(TestCase):
15     @classmethod
16     def setUpTestData(cls):
17         make_lab(name="TestLab")
18         cls.client = Client()
19
20     def test_landing_view_anon(self):
21         response = self.client.get('/')
22         self.assertEqual(response.status_code, 200)
23
24     def test_lab_list_view(self):
25         response = self.client.get('/lab/')
26         self.assertEqual(response.status_code, 200)
27
28     def test_lab_detail_view(self):
29         response = self.client.get('/lab/TestLab/')
30         self.assertEqual(response.status_code, 200)