Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 16
0
 def test_not_authenticated(self):
     response = self.client.post(self.url, dict(wikiText="= Bla =\nBlubb."))
     assert_is_error_response(response, "_NotAuthenticated")