

def test_page_no_too_large_returns_last_page(self):
    events_url = reverse('all_events')
    events_url += '?items_per_page=10&page=999'
    response = self.client.get(events_url)
    view_events = response.context['all_events']
    assert (len(view_events) == 10)
    assert (view_events.number == 5)

dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py TestEventViews.test_page_no_too_large_returns_last_page/original