Translate english
This commit is contained in:
28
tests/library/test_model.py
Normal file
28
tests/library/test_model.py
Normal file
@ -0,0 +1,28 @@
|
||||
# tests/Library/test_model.py
|
||||
|
||||
import pytest
|
||||
from app.library.models import Book
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_book_model():
|
||||
|
||||
## Given
|
||||
book = Book(
|
||||
title="The foundation",
|
||||
genre="Science fiction",
|
||||
year="1951",
|
||||
author="Isaac Asimov",
|
||||
)
|
||||
book.save()
|
||||
|
||||
## When
|
||||
|
||||
## Then
|
||||
assert book.title == "The foundation"
|
||||
assert book.genre == "Science fiction"
|
||||
assert book.year == "1951"
|
||||
assert book.author == "Isaac Asimov"
|
||||
assert book.created_at
|
||||
assert book.updated_at
|
||||
assert str(book) == book.title
|
Reference in New Issue
Block a user