2020-05-03 00:45:45 +02:00
|
|
|
from datetime import datetime
|
2020-05-01 20:17:46 +02:00
|
|
|
|
2020-07-03 13:30:01 +02:00
|
|
|
from database import SessionLocal
|
|
|
|
from database.models import *
|
|
|
|
|
2020-07-24 19:27:15 +02:00
|
|
|
|
2020-07-03 13:30:01 +02:00
|
|
|
db = SessionLocal()
|
|
|
|
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
def test_users():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Users).filter(Users.id == 260).first()
|
|
|
|
assert test.email == "testaccountjugador@gmail.com"
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_cities():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Cities).filter(Cities.id == 7).first()
|
|
|
|
assert test.name == "Lyon"
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_games():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Games).filter(Games.id == 508).first()
|
2020-07-04 20:15:55 +02:00
|
|
|
assert test.user_id == 1978
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_payments():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Payments).filter(Payments.id == 375).first()
|
|
|
|
assert test.user_id == 88
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_player_availabilities():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(PlayerAvailabilities).filter(PlayerAvailabilities.id == 248).first()
|
|
|
|
assert test.game_id == 89
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_player_cancel_games():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(PlayerCancelGames).filter(PlayerCancelGames.id == 67).first()
|
|
|
|
assert test.player_id == 44
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_purchase_games():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(PurchaseGames).filter(PurchaseGames.id == 235).first()
|
|
|
|
assert test.game_id == 50
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_sports():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Sports).filter(Sports.id == 4).first()
|
2020-05-01 20:17:46 +02:00
|
|
|
assert test.name == "Volleyball"
|
|
|
|
|
|
|
|
|
|
|
|
def test_teams():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Teams).filter(Teams.id == 306).first()
|
2020-05-01 20:17:46 +02:00
|
|
|
assert test.game_id == 64
|
|
|
|
|
|
|
|
|
|
|
|
def test_user_ratings():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(UserRatings).filter(UserRatings.id == 287).first()
|
|
|
|
assert test.user_id == 60
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_venue_images():
|
2020-07-03 13:30:01 +02:00
|
|
|
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
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_venues():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(Venues).filter(Venues.id == 26).first()
|
|
|
|
assert test.name == "Le tuto "
|
2020-05-01 20:17:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_web_bookings():
|
2020-07-03 13:30:01 +02:00
|
|
|
test = db.query(WebBookings).filter(WebBookings.id == 7).first()
|
|
|
|
assert test.game == "Soccer"
|