text: from tests.Base import BaseTest
  
  class TestIndexPageAccessCritera(BaseTest):
  
      """
      Testing the root of the server behaves as expected when an admin/std/unauthenticated user.
  
      Admin: should be allowed access
      Std: Should be allwed access
      Unauthenticated: Should be redirected to login
      """
  
      def setUp(self):
          super().setUp()
          self.url = self.generate_url('index')
  
      def test_redirected_to_login_while_not_authenticated(self):
          tester = self.anonymous_user()
          resp = tester.get(self.url)
          self.assertEqual(302, resp.status_code)
  
      def test_allowed_while_authenticated_as_admin(self):
          tester = self.login_as_user_id(self.admin_user.id)
          resp = tester.get(self.url)
          self.assertEqual(200, resp.status_code)
  
      def test_allowed_while_authenticated_as_std_user(self):
          tester = self.login_as_user_id(self.std_user.id)
          resp = tester.get(self.url)
          self.assertEqual(200, resp.status_code)