示例#1
0
 def test_on_illegal_path_gives_error_response(self):
     illegal_paths = ['Wahlprogramm.1/foo',
                      'Wahlprogramm.1/foo.1.pro']
     for p in illegal_paths:
         response = self.client.get(
             reverse('load_text', kwargs=dict(path=p)))
         assert_is_error_response(response, "_IllegalPath")
示例#2
0
 def test_not_permitted(self):
     self.assertTrue(self.client.login(username="******", password="******"))
     response = self.client.post(
         reverse('mark_node_unfollow', kwargs=dict(path="Slot.1")))
     assert_is_error_response(response, "_PermissionDenied")
示例#3
0
 def test_on_non_existing_node_gives_error_response(self):
     response = self.client.get(
         reverse('load_node', kwargs=dict(path='doesnotexist.1')))
     assert_is_error_response(response, "_UnknownNode")
示例#4
0
 def test_not_logged_in_returns_error_response(self):
     response = self.client.get(reverse('load_user_settings'))
     assert_is_error_response(response, "_NotAuthenticated")
示例#5
0
 def test_not_authenticated(self):
     response = self.client.post(
         reverse('mark_node_unfollow', kwargs=dict(path="Slot.1")))
     assert_is_error_response(response, "_NotAuthenticated")
示例#6
0
 def test_unavailable_displayname_returns_error(self):
     self.hugo = create_user('hugo', description='notHulk', password="******")
     self.assertTrue(self.client.login(username="******", password='******'))
     response = self.post(reverse('store_settings'),
                          dict(displayName='hugo', description=''))
     assert_is_error_response(response, "_UsernameNotAvailable")
示例#7
0
 def test_with_invalid_username_returns_error_response(self):
     for n in ['hannes', 'harbart', 'nieh']:
         response = self.client.get(
             reverse('load_user_info', kwargs=dict(name=n)))
         assert_is_error_response(response, "_UnknownUser")
示例#8
0
 def test_not_permitted(self):
     self.assertTrue(self.client.login(username="******", password="******"))
     response = self.client.post(
         reverse('mark_node_unfollow', kwargs=dict(path="Slot.1")))
     assert_is_error_response(response, "_PermissionDenied")
示例#9
0
 def test_missing_displayname_parameter_returns_error(self):
     self.assertTrue(self.client.login(username="******", password='******'))
     response = self.post(reverse('store_settings'),
                          dict(description=''))
     assert_is_error_response(response, "_MissingPOSTParameter")
示例#10
0
 def test_on_non_existing_node_gives_error_response(self):
     response = self.client.get(
         reverse('load_argument_index', kwargs=dict(path='doesnotexist.1')))
     assert_is_error_response(response, "_UnknownNode")
示例#11
0
 def test_not_authenticated(self):
     response = self.client.post(
         reverse('mark_node_unfollow', kwargs=dict(path="Slot.1")))
     assert_is_error_response(response, "_NotAuthenticated")
示例#12
0
 def test_on_illegal_path_gives_error_response(self):
     illegal_paths = ['Wahlprogramm.1/foo.1.pro.2']
     for p in illegal_paths:
         response = self.client.get(
             reverse('load_index', kwargs=dict(path=p)))
         assert_is_error_response(response, "_IllegalPath")
示例#13
0
 def test_store_missing_argument_type(self):
     self.assertTrue(self.client.login(username="******", password="******"))
     response = self.client.post(self.url, dict(wikiText="= Hopp =\nGrumpf.",
                                                wikiTextAlternative="= Bla =\nBlubb."))
     assert_is_error_response(response, "_MissingPOSTParameter")
示例#14
0
 def test_store_missing_text(self):
     self.assertTrue(self.client.login(username="******", password="******"))
     response = self.client.post(self.url)
     assert_is_error_response(response, "_MissingPOSTParameter")
示例#15
0
 def test_not_permitted(self):
     self.assertTrue(
         self.client.login(username="******", password="******"))
     response = self.client.post(self.url, dict(wikiText="= Bla =\nBlubb."))
     assert_is_error_response(response, "_PermissionDenied")
示例#16
0
 def test_not_authenticated(self):
     response = self.client.post(self.url, dict(wikiText="= Bla =\nBlubb."))
     assert_is_error_response(response, "_NotAuthenticated")