(self)
| 4326 | ) |
| 4327 | |
| 4328 | def test_pokeathlon_stat_api(self): |
| 4329 | pokeathlon_stat = self.setup_pokeathlon_stat_data(name="base pkathln stt") |
| 4330 | pokeathlon_stat_name = self.setup_pokeathlon_stat_name_data( |
| 4331 | pokeathlon_stat, name="base pkathln stt name" |
| 4332 | ) |
| 4333 | |
| 4334 | response = self.client.get( |
| 4335 | "{}/pokeathlon-stat/{}/".format(API_V2, pokeathlon_stat.pk) |
| 4336 | ) |
| 4337 | |
| 4338 | self.assertEqual(response.status_code, status.HTTP_200_OK) |
| 4339 | |
| 4340 | # base params |
| 4341 | self.assertEqual(response.data["id"], pokeathlon_stat.pk) |
| 4342 | self.assertEqual(response.data["name"], pokeathlon_stat.name) |
| 4343 | # name params |
| 4344 | self.assertEqual(response.data["names"][0]["name"], pokeathlon_stat_name.name) |
| 4345 | self.assertEqual( |
| 4346 | response.data["names"][0]["language"]["name"], |
| 4347 | pokeathlon_stat_name.language.name, |
| 4348 | ) |
| 4349 | self.assertEqual( |
| 4350 | response.data["names"][0]["language"]["url"], |
| 4351 | "{}{}/language/{}/".format( |
| 4352 | TEST_HOST, API_V2, pokeathlon_stat_name.language.pk |
| 4353 | ), |
| 4354 | ) |
| 4355 | |
| 4356 | # Characteristic Tests |
| 4357 | def test_characteristic_api(self): |
nothing calls this directly
no test coverage detected