odapi/tests/queries_test.py

73 lines
1.8 KiB
Python
Raw Normal View History

2020-05-03 00:45:45 +02:00
from datetime import datetime
from database import SessionLocal
from database.models import *
db = SessionLocal()
def test_users():
test = db.query(Users).filter(Users.id == 260).first()
assert test.email == "testaccountjugador@gmail.com"
def test_cities():
test = db.query(Cities).filter(Cities.id == 7).first()
assert test.name == "Lyon"
def test_games():
test = db.query(Games).filter(Games.id == 508).first()
2020-07-04 20:15:55 +02:00
assert test.user_id == 1978
def test_payments():
test = db.query(Payments).filter(Payments.id == 375).first()
assert test.user_id == 88
def test_player_availabilities():
test = db.query(PlayerAvailabilities).filter(PlayerAvailabilities.id == 248).first()
assert test.game_id == 89
def test_player_cancel_games():
test = db.query(PlayerCancelGames).filter(PlayerCancelGames.id == 67).first()
assert test.player_id == 44
def test_purchase_games():
test = db.query(PurchaseGames).filter(PurchaseGames.id == 235).first()
assert test.game_id == 50
def test_sports():
test = db.query(Sports).filter(Sports.id == 4).first()
assert test.name == "Volleyball"
def test_teams():
test = db.query(Teams).filter(Teams.id == 306).first()
assert test.game_id == 64
def test_user_ratings():
test = db.query(UserRatings).filter(UserRatings.id == 287).first()
assert test.user_id == 60
def test_venue_images():
test = db.query(VenueImages).filter(VenueImages.id == 3).first()
date = datetime(year=2019, month=6, day=3, hour=5, minute=43, second=22)
assert test.created == date
def test_venues():
test = db.query(Venues).filter(Venues.id == 26).first()
assert test.name == "Le tuto "
def test_web_bookings():
test = db.query(WebBookings).filter(WebBookings.id == 7).first()
assert test.game == "Soccer"