Exemple #1
0
 def test_request_required(self):
     with self.assertRaises(RequiredForCondition):
         path_condition("/my/path")
Exemple #2
0
 def test_path_condition_invalid(self):
     self.request.path = "/your/path"
     self.assertFalse(path_condition("/my/path", request=self.request))
Exemple #3
0
 def test_path_condition_valid_subpath(self):
     self.request.path = "/my/path/to/somewhere"
     self.assertTrue(path_condition("/my/path", request=self.request))
Exemple #4
0
 def test_path_condition_valid_not_starting_with(self):
     self.request.path = "/subsection/my/path"
     self.assertTrue(path_condition("/my/path", request=self.request))
Exemple #5
0
 def test_path_condition_valid_exact(self):
     self.request.path = "/my/path"
     self.assertTrue(path_condition("/my/path", request=self.request))