RED: we still need to created the view

This commit is contained in:
Colin Goutte 2023-08-25 12:10:37 +02:00
parent 97cf596ea7
commit 5f96a4b82a
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy import Column, ForeignKey, Integer, String
from database import Base
@ -7,3 +7,5 @@ class Movie(Base):
__tablename__ = "movies"
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)

View File

@ -44,8 +44,8 @@ def test_create_movie_api():
import random
name = f"rand_{random.randint(1, 1000)}"
response = client.post("movie", {"name": name})
assert response.status == 200
response = client.post("/movies/", json={"name": name})
assert response.status_code == 200
movie_id = response.json()["id"]
response = client.get("movie", movie_id)
assert response.json()["name"] == name