odapi/tests/queries_test.py

75 lines
1.7 KiB
Python

from database.models import *
from datetime import datetime
def test_users():
deepak = Users.query.filter_by(id=46).first()
assert deepak.email == "deepak@yopmail.com"
def test_cities():
beirut = Cities.query.filter_by(id=12).first()
assert beirut.name == "Beirut"
def test_games():
test = Games.query.filter_by(id=63).first()
assert test.user_id == 255
def test_payments():
test = Payments.query.filter_by(id=295).first()
assert test.user_id == 260
def test_player_availabilities():
test = PlayerAvailabilities.query.filter_by(id=256).first()
assert test.game_id == 94
def test_player_cancel_games():
test = PlayerCancelGames.query.filter_by(id=132).first()
assert test.player_id == 137
def test_purchase_games():
test = PurchaseGames.query.filter_by(id=268).first()
assert test.game_id == 64
def test_sports():
test = Sports.query.filter_by(id=4).first()
assert test.name == "Volleyball"
def test_teams():
test = Teams.query.filter_by(id=306).first()
assert test.game_id == 64
def test_user_ratings():
test = UserRatings.query.filter_by(id=420).first()
assert test.user_id == 21
def test_venue_images():
test = VenueImages.query.filter_by(id=6).first()
date = datetime(year=2019, month=7, day=28, hour=14, minute=1, second=21)
assert test.updated == date
def test_venues():
test = Venues.query.filter_by(id=28).first()
assert test.name == "Santiago Bernabéu"
def test_view_news():
test = ViewNews.query.filter_by(id=57).first()
date = datetime(year=2019, month=7, day=16, hour=11, minute=32, second=16)
assert test.created == date
def test_web_bookings():
test = WebBookings.query.filter_by(id=9).first()
assert test.game == "Fútbol "