format
This commit is contained in:
@ -4,6 +4,7 @@ import pytest
|
||||
|
||||
from app.libros.models import Libros
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_libros_model():
|
||||
|
||||
@ -26,4 +27,4 @@ def test_libros_model():
|
||||
assert libro.author == "Isaac Asimov"
|
||||
assert libro.created_at
|
||||
assert libro.updated_at
|
||||
assert str(libro) == libro.title
|
||||
assert str(libro) == libro.title
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
from app.libros.serializers import LibroSerializer
|
||||
|
||||
|
||||
def test_valid_libro_serializer():
|
||||
valid_serializer_data = {
|
||||
"title": "Raising Arizona",
|
||||
|
@ -20,7 +20,7 @@ def test_add_book(client):
|
||||
"author": "Isaac Asimov",
|
||||
"year": "1955",
|
||||
},
|
||||
content_type="application/json"
|
||||
content_type="application/json",
|
||||
)
|
||||
|
||||
# Then
|
||||
@ -40,7 +40,7 @@ def test_get_single_book(client):
|
||||
genre="Ciencia Ficción",
|
||||
author="Isaac Asimov",
|
||||
year="1955",
|
||||
)
|
||||
)
|
||||
|
||||
# When
|
||||
resp = client.get(f"/api/libros/{libro.id}/")
|
||||
@ -154,7 +154,7 @@ def test_update_book(client):
|
||||
"author": "Frank Herbert",
|
||||
"year": "1965",
|
||||
},
|
||||
content_type="application/json"
|
||||
content_type="application/json",
|
||||
)
|
||||
|
||||
# Then
|
||||
@ -195,8 +195,8 @@ def test_update_book_invalid_json(client):
|
||||
"foo": "Dune",
|
||||
"boo": "Ciencia Ficción",
|
||||
},
|
||||
content_type="application/json"
|
||||
content_type="application/json",
|
||||
)
|
||||
|
||||
# Then
|
||||
assert resp.status_code == 400
|
||||
assert resp.status_code == 400
|
||||
|
Reference in New Issue
Block a user