RED: we still need to created the view
This commit is contained in:
parent
97cf596ea7
commit
5f96a4b82a
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue