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