def test_custom_url(client): """Custom page, on it's own URL, so should display correctly.""" default_scenario_block() get_page_custom_calendar() response = client.get(reverse('calendar.information')) assert 200 == response.status_code assert 'Jan' in str(response.content) assert 'Feb' in str(response.content) assert 'Mar' in str(response.content)
def test_custom_url_page_view(client): """Custom page, on it's block URL, so should throw an exception.""" default_scenario_block() page = get_page_custom_calendar() with pytest.raises(BlockError) as excinfo: client.get(page.get_absolute_url()) assert 'should NOT match' in str(excinfo.value)