| Total Complexity | 2 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python3 |
||
| 2 | # -*- coding: utf-8 -*- |
||
| 3 | """ |
||
| 4 | Created on Fri Sep 27 15:59:57 2019 |
||
| 5 | |||
| 6 | @author: Paolo Cozzi <[email protected]> |
||
| 7 | """ |
||
| 8 | |||
| 9 | from django.test import TestCase, Client |
||
| 10 | from django.urls import resolve, reverse |
||
| 11 | |||
| 12 | from common.tests import GeneralMixinTestCase |
||
| 13 | |||
| 14 | from ..views import OntologiesReportView |
||
| 15 | |||
| 16 | |||
| 17 | class OntologiesReportViewTest(GeneralMixinTestCase, TestCase): |
||
| 18 | |||
| 19 | fixtures = [ |
||
| 20 | "image_app/user", |
||
| 21 | 'image_app/dictbreed', |
||
| 22 | 'image_app/dictcountry', |
||
| 23 | 'image_app/dictrole', |
||
| 24 | 'image_app/dictsex', |
||
| 25 | 'image_app/dictspecie', |
||
| 26 | 'image_app/dictstage', |
||
| 27 | 'image_app/dictuberon', |
||
| 28 | ] |
||
| 29 | |||
| 30 | def setUp(self): |
||
| 31 | """Set up""" |
||
| 32 | |||
| 33 | super().setUp() |
||
| 34 | |||
| 35 | # authenticate |
||
| 36 | self.client = Client() |
||
| 37 | self.client.login(username='test', password='test') |
||
| 38 | |||
| 39 | # get the url for dashboard |
||
| 40 | self.url = reverse('zooma:ontologies_report') |
||
| 41 | |||
| 42 | # get a response |
||
| 43 | self.response = self.client.get(self.url) |
||
| 44 | |||
| 45 | def test_url_resolves_view(self): |
||
| 46 | view = resolve('/zooma/ontologies_report/') |
||
| 47 | self.assertIsInstance(view.func.view_class(), OntologiesReportView) |
||
| 48 |