1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.test import TestCase
6 from .models import Offer, Perk, Funding
9 class FundTest(TestCase):
11 self.offer1 = Offer.objects.create(
12 author='author1', title='title1', slug='slug1',
13 target=100, start='2013-03-01', end='2013-03-31')
16 perk = Perk.objects.create(price=20, name='Perk 20')
17 perk1 = Perk.objects.create(offer=self.offer1, price=50, name='Perk 50')
18 offer2 = Offer.objects.create(
19 author='author2', title='title2', slug='slug2',
20 target=100, start='2013-02-01', end='2013-02-20')
21 perk2 = Perk.objects.create(offer=offer2, price=1, name='Perk 1')
24 set(self.offer1.fund('Tester', 'test@example.com', 10).perks.all()),
27 set(self.offer1.fund('Tester', 'test@example.com', 70).perks.all()),