def test_wrong_range(self): _add_document(544590) _add_document(67040491) context = {'laws': Document.objects.all()} context = build_laws_list_context(context, {'range': '1/1/2015-1/1/2016'}) self.assertEqual(len(context['laws']), 2)
def test_search_by_name(self): _add_document(544590) _add_document(67040491) context = {'laws': Document.objects.all()} context = build_laws_list_context(context, {'search': 'Portaria 112/2015'}) self.assertEqual(len(context['laws']), 1) self.assertEqual(context['laws'][0].dre_doc_id, 67040491)
def test_too_high_page(self): context = {'laws': Document.objects.all()} context = build_laws_list_context(context, {'page': 100}) self.assertEqual(len(context['laws']), 0)