Adicionar teste POST pokemon duplicado

This commit is contained in:
Augusto Gunsch 2021-10-19 12:19:53 -03:00
parent 27a40f28a7
commit 53e8dc40b4
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 10 additions and 0 deletions

View File

@ -250,6 +250,16 @@ class MainTestCase(TestCase):
self.assertIn(b"Dummy", response.data) self.assertIn(b"Dummy", response.data)
self.assertIn(b"pokemon_data", response.data) self.assertIn(b"pokemon_data", response.data)
def test_post_pokemon_duplicate(self):
data = {
"name": "Poltergeist",
"level": 2,
"pokemon_id": 12
}
self.client.post("/trainer/2/pokemon", json=data, headers={"Authorization":self.token_joao}, follow_redirects=True)
response = self.client.post("/trainer/2/pokemon", json=data, headers={"Authorization":self.token_joao}, follow_redirects=True)
self.assert_status(response, 409)
def test_post_pokemon_trainer_not_found(self): def test_post_pokemon_trainer_not_found(self):
data = { data = {
"name": "Dummy", "name": "Dummy",