def test_join_date(self): share = ShareFactory() BetFactory(share=share, start_date=date(2019, 1, 1)) BetFactory(share=share, start_date=date(2018, 1, 1), end_date=date(2018, 12, 31)) assert share.join_date == datetime(2018, 1, 1)
def test_jsonify(self): share = ShareFactory.create() bet = BetFactory(share=share) expected = { 'start_date': datetime(2018, 1, 1, 0, 0), 'end_date': None, 'id': bet.id, 'value': Decimal('90'), 'share_id': share.id } assert bet.json == expected