# Path: bot/games/tests/factories.py
# class GameFactory(factory.django.DjangoModelFactory):
# 
#     name = factory.Faker('bs')
# 
#     class Meta:
#         model = 'games.Game'
# 
# Path: bot/plugins/stats/tests/factories.py
# class GameSessionFactory(factory.django.DjangoModelFactory):
# 
#     member = factory.SubFactory('bot.users.tests.factories.MemberFactory')
#     game = factory.SubFactory('bot.games.tests.factories.GameFactory')
# 
#     start = factory.fuzzy.FuzzyDateTime(
#         start_dt=timezone.now() - timedelta(hours=1),
#         end_dt=timezone.now() - timedelta(minutes=30)
#     )
#     stop = factory.fuzzy.FuzzyDateTime(start_dt=timezone.now() - timedelta(minutes=30))
#     duration = factory.LazyAttribute(lambda o: o.stop - o.start)
# 
#     class Meta:
#         model = 'stats.GameSession'


from django.test import TestCase
from bot.games.tests.factories import GameFactory
from .factories import GameSessionFactory




class GamePostSaveTests(TestCase):

    def test_game_session_updated_if_game_is_alias(self):
        gta_v = GameFactory.create(name='Grand Theft Auto V')

# Path: bot/games/tests/factories.py
# class GameFactory(factory.django.DjangoModelFactory):
# 
#     name = factory.Faker('bs')
# 
#     class Meta:
#         model = 'games.Game'
# 
# Path: bot/plugins/stats/tests/factories.py
# class GameSessionFactory(factory.django.DjangoModelFactory):
# 
#     member = factory.SubFactory('bot.users.tests.factories.MemberFactory')
#     game = factory.SubFactory('bot.games.tests.factories.GameFactory')
# 
#     start = factory.fuzzy.FuzzyDateTime(
#         start_dt=timezone.now() - timedelta(hours=1),
#         end_dt=timezone.now() - timedelta(minutes=30)
#     )
#     stop = factory.fuzzy.FuzzyDateTime(start_dt=timezone.now() - timedelta(minutes=30))
#     duration = factory.LazyAttribute(lambda o: o.stop - o.start)
# 
#     class Meta:
#         model = 'stats.GameSession'


# Path: bot/plugins/stats/tests/test_game_post_save.py
from django.test import TestCase
from bot.games.tests.factories import GameFactory
from .factories import GameSessionFactory





class GamePostSaveTests(TestCase):

    def test_game_session_updated_if_game_is_alias(self):
        gta_v = GameFactory.create(name='Grand Theft Auto V')

        gta_v2 = GameFactory.create(name='GTA V')