예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
 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)
예제 #6
0
 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)