예제 #1
0
 def test_request_required(self):
     with self.assertRaises(RequiredForCondition):
         path_condition("/my/path")
예제 #2
0
 def test_path_condition_invalid(self):
     self.request.path = "/your/path"
     self.assertFalse(path_condition("/my/path", request=self.request))
예제 #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))
예제 #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))
예제 #5
0
 def test_path_condition_valid_exact(self):
     self.request.path = "/my/path"
     self.assertTrue(path_condition("/my/path", request=self.request))