Ejemplo n.º 1
0
 def test_action_url_s_id(self):
     """
     When a valid request is made to the login view, the form action
     URL should contain the configured school ID query parameter.
     """
     request = self.rf.get(self.valid_login)
     response = ParchmentView.as_view()(request)
     self.assertContains(response, 's_id=1234567890abcdef')
Ejemplo n.º 2
0
 def test_debug_field(self):
     """
     When a valid request is made to the login view and debug mode is
     enabled, it should contain a hidden ``debug`` field.
     """
     request = self.rf.get(self.valid_login)
     response = ParchmentView.as_view()(request)
     self.assertContains(response, '<input id="id_debug" name="debug" type="hidden" value="')
Ejemplo n.º 3
0
 def test_bad_response(self):
     """
     When an invalid request is made to the login view, it should return
     a 400 Bad Response.
     """
     request = self.rf.get(self.invalid_login)
     response = ParchmentView.as_view()(request)
     self.assertEquals(response.status_code, 400)
Ejemplo n.º 4
0
 def test_parchiv_field(self):
     """
     When a valid request is made to the login view, it should contain
     a hidden ``parchiv`` field.
     """
     request = self.rf.get(self.valid_login)
     response = ParchmentView.as_view()(request)
     self.assertContains(response, '<input id="id_parchiv" name="parchiv" type="hidden" value="')
Ejemplo n.º 5
0
 def test_view_template(self):
     """
     When a request is made to the login view, the correct template
     should be utilized.
     """
     request = self.rf.get(self.valid_login)
     response = ParchmentView.as_view()(request)
     self.assertTemplateUsed(response, 'parchment/login.html')