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")
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")
def test_not_logged_in_returns_error_response(self): response = self.client.get(reverse('load_user_settings')) assert_is_error_response(response, "_NotAuthenticated")
def test_not_authenticated(self): response = self.client.post( reverse('mark_node_unfollow', kwargs=dict(path="Slot.1"))) assert_is_error_response(response, "_NotAuthenticated")
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")
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")
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")
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")
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")
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")
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")
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")
def test_not_authenticated(self): response = self.client.post(self.url, dict(wikiText="= Bla =\nBlubb.")) assert_is_error_response(response, "_NotAuthenticated")