| @@ 140-158 (lines=19) @@ | ||
| 137 | self.check_generator(samples, 3) |
|
| 138 | ||
| 139 | # TODO: pretty similar to CRBanim - move to a common mixin |
|
| 140 | def test_check_species(self): |
|
| 141 | """Test check species method""" |
|
| 142 | ||
| 143 | # get a country |
|
| 144 | country = DictCountry.objects.get(label="United Kingdom") |
|
| 145 | ||
| 146 | check, not_found = self.reader.check_species(country) |
|
| 147 | ||
| 148 | self.assertTrue(check) |
|
| 149 | self.assertEqual(len(not_found), 0) |
|
| 150 | ||
| 151 | # changing species set |
|
| 152 | DictSpecie.objects.filter(label='Sus scrofa').delete() |
|
| 153 | ||
| 154 | check, not_found = self.reader.check_species(country) |
|
| 155 | ||
| 156 | # the read species are not included in fixtures |
|
| 157 | self.assertFalse(check) |
|
| 158 | self.assertGreater(len(not_found), 0) |
|
| 159 | ||
| 160 | # TODO: identical to CRBanim - move to a common mixin |
|
| 161 | def test_check_sex(self): |
|
| @@ 125-143 (lines=19) @@ | ||
| 122 | self.reader.print_line(0) |
|
| 123 | self.assertLogs(logger=logger, level=logging.DEBUG) |
|
| 124 | ||
| 125 | def test_check_species(self): |
|
| 126 | """Test check species method""" |
|
| 127 | ||
| 128 | # get a country |
|
| 129 | country = DictCountry.objects.get(label="United Kingdom") |
|
| 130 | ||
| 131 | check, not_found = self.reader.check_species(country) |
|
| 132 | ||
| 133 | self.assertTrue(check) |
|
| 134 | self.assertEqual(len(not_found), 0) |
|
| 135 | ||
| 136 | # changing species set |
|
| 137 | DictSpecie.objects.filter(label='Bos taurus').delete() |
|
| 138 | ||
| 139 | check, not_found = self.reader.check_species(country) |
|
| 140 | ||
| 141 | # the read species are not included in fixtures |
|
| 142 | self.assertFalse(check) |
|
| 143 | self.assertGreater(len(not_found), 0) |
|
| 144 | ||
| 145 | def test_check_sex(self): |
|
| 146 | """Test check sex method""" |
|