def test_content_view_with_alias(self): """ Test view properly /cms/content/<node_id> :return: None """ response = assert_basic(self, self.node_rev_basic.node_id, 'content_node') self.assertRedirects(response, url_with_lang('/about/'), status_code=301)
def test_node_view_with_basic(self): """ Test basic node Test node view of basic page, slash is missing (expecting redirect) Test node view of basic page properly :return: None """ response = assert_basic(self, 'about') self.assertRedirects(response, url_with_lang('/about/'), status_code=301) assert_basic(self, 'about/')
def test_content_view_alias_unpublished(self): """ Test that an unpublished node with alias gets 403 :return: None """ self.node_rev_basic.node.status = False self.node_rev_basic.node.save() response = self.client.get(url_with_lang('/about/')) self.assertEqual(response.status_code, 403) self.node_rev_basic.node.status = True self.node_rev_basic.node.save()
def test_node_view_with_basic_two_level(self): """ Test basic node, two levels in alias Test node view of basic page, slash is missing (expecting redirect) Test properly, slash is not missing :return: None """ create_basic('about/company') response = assert_basic(self, 'about/company') self.assertRedirects(response, url_with_lang('/about/company/'), status_code=301) assert_basic(self, 'about/company/')