예제 #1
0
    def setUp(self):
        super(REST, self).setUp()

        self.url = reverse('members-status')

        # Active member
        self.user_valid = create_user_with_member(
            first_name='active',
            email='*****@*****.**',
        )
        self.member_valid = self.user_valid.member
        payment_type = PaymentType.objects.create(
            category=self.member_valid.category,
            price=50.0,
            duration=10
        )
        self.payment = Payment.objects.create(
            member=self.member_valid,
            type=payment_type,
            date=timezone.now(),
            valid_until=timezone.now() + timedelta(days=10, minutes=1)
        )
        self.transaction = Transaction.objects.create(
            payment=self.payment,
            code='fake-code',
            status=3,
            price=50.0
        )

        # Inactive member
        self.user_invalid = create_user_with_member(
            first_name='inactive',
            email='*****@*****.**',
        )
예제 #2
0
    def setUp(self):
        self.url = reverse('members-status')

        # Active member
        self.user_valid = create_user_with_member(
            first_name='active',
            email='*****@*****.**',
        )
        self.member_valid = self.user_valid.member
        payment_type = PaymentType.objects.create(
            category=self.member_valid.category, price=50.0, duration=10)
        self.payment = Payment.objects.create(member=self.member_valid,
                                              type=payment_type,
                                              date=timezone.now(),
                                              valid_until=timezone.now() +
                                              timedelta(days=10, minutes=1))
        self.transaction = Transaction.objects.create(payment=self.payment,
                                                      code='fake-code',
                                                      status=3,
                                                      price=50.0)

        # Inactive member
        self.user_invalid = create_user_with_member(
            first_name='inactive',
            email='*****@*****.**',
        )
    def setUp(self):
        category = Category.objects.get(id=2)
        create_user_with_member(first_name='teste', last_name='teste')
        create_user_with_member(first_name='dolor', last_name='sit')
        create_user_with_member(first_name='lorem', last_name='ipsum', category=category)
        create_user_with_member(first_name='amet', last_name='consectetur', category=category)
        create_user_with_member(first_name='python',
                                last_name='long name user',
                                category=category)

        self.url = reverse('members-list')
        self.response = self.client.get(self.url)
예제 #4
0
    def setUp(self):
        category = Category.objects.get(id=2)
        create_user_with_member(first_name='teste', last_name='teste')
        create_user_with_member(first_name='dolor', last_name='sit')
        create_user_with_member(first_name='lorem',
                                last_name='ipsum',
                                category=category)
        create_user_with_member(first_name='amet',
                                last_name='consectetur',
                                category=category)
        create_user_with_member(first_name='python',
                                last_name='long name user',
                                category=category)

        self.url = reverse('members-list')
        self.response = self.client.get(self.url)
예제 #5
0
    def setUp(self):
        super(DashboardView, self).setUp()

        self.url = reverse('members-dashboard')
        self.user = create_user_with_member(first_name='test', last_name='fake')
        self.client.login(username='******', password='******')
        self.response = self.client.get(self.url)
예제 #6
0
    def setUp(self):
        user = create_user_with_member(first_name='tes')

        self.member = user.member

        payment_type = PaymentType.objects.create(
            category=self.member.category, price=50.0, duration=10)

        # first payment
        self.payment = Payment.objects.create(
            member=self.member,
            type=payment_type,
            date=timezone.now() - timedelta(days=670),
            valid_until=timezone.now() - timedelta(days=365))

        self.payment = Payment.objects.create(member=self.member,
                                              type=payment_type,
                                              date=timezone.now(),
                                              valid_until=timezone.now() +
                                              timedelta(days=10, minutes=1))

        self.transaction = Transaction.objects.create(payment=self.payment,
                                                      code='fake-code',
                                                      status=0,
                                                      price=50.0)
    def setUp(self):
        user = create_user_with_member(
            first_name='tes'
        )

        self.member = user.member

        payment_type = PaymentType.objects.create(
            category=self.member.category,
            price=50.0,
            duration=10
        )

        # first payment
        self.payment = Payment.objects.create(
            member=self.member,
            type=payment_type,
            date=timezone.now() - timedelta(days=670),
            valid_until=timezone.now() - timedelta(days=365)
        )

        self.payment = Payment.objects.create(
            member=self.member,
            type=payment_type,
            date=timezone.now(),
            valid_until=timezone.now() + timedelta(days=10, minutes=1)
        )

        self.transaction = Transaction.objects.create(
            payment=self.payment,
            code='fake-code',
            status=0,
            price=50.0
        )
예제 #8
0
 def test_should_upgrade_last_payment(self):
     user = create_user_with_member()
     payment = Payment.objects.create(member=user.member,
                                      type=PaymentType.objects.get(id=1))
     transaction = Transaction.objects.create(payment=payment,
                                              status=0,
                                              code='fakecode',
                                              price='0.0')
     self.assertEqual(transaction, payment.last_transaction)
    def setUp(self):
        super(MemberListViewTest, self).setUp()

        category = Category.objects.get(id=2)
        create_user_with_member(first_name='test', last_name='test')
        create_user_with_member(first_name='dolor', last_name='sit')
        create_user_with_member(first_name='lorem', last_name='ipsum', category=category)
        create_user_with_member(first_name='amet', last_name='consectetur', category=category)

        self.url = reverse('members-list')
        self.response = self.client.get(self.url)
 def test_should_upgrade_last_payment(self):
     user = create_user_with_member()
     payment = Payment.objects.create(
         member = user.member,
         type = PaymentType.objects.get(id=1)
     )
     transaction = Transaction.objects.create(
         payment=payment,
         status=0,
         code='fakecode',
         price='0.0'
     )
     self.assertEqual(transaction, payment.last_transaction)
예제 #11
0
    def setUp(self):
        self.url = reverse('members-form')
        self.user = create_user_with_member(first_name='test',
                                            last_name='fake')
        self.client.login(username='******', password='******')
        self.response = self.client.get(self.url)
        self.dom = lhtml.fromstring(self.response.content)

        self.data = {
            'category': '1',
            'partner': '',
            'mailing': '',
            'first_name': 'editou',
            'last_name': 'editou',
        }
    def setUp(self):
        self.url = reverse('members-form')
        self.user = create_user_with_member(first_name='test', last_name='fake')
        self.client.login(username='******', password='******')
        self.response = self.client.get(self.url)
        self.dom = lhtml.fromstring(self.response.content)

        self.data = {
            u'category': u'1',
            u'partner': u'',
            u'mailing': u'',
            u'email': u'*****@*****.**',
            u'first_name': u'editou',
            u'last_name': u'editou',
        }
    def setUp(self):
        self.url = reverse('members-form')
        self.user = create_user_with_member(first_name='test', last_name='fake')
        self.client.login(username='******', password='******')
        self.response = self.client.get(self.url)
        self.dom = lhtml.fromstring(self.response.content)

        self.data = {
            u'category': u'1',
            u'location': u'editou',
            u'organization': u'editou',
            u'relation_with_community': u'editou',
            u'phone': u'12-1212-1212',
            u'cpf': u'71763224490',
            u'state': u'editou',
            u'address': u'address',
            u'partner': u'',
            u'mailing': u'',
            u'email': u'*****@*****.**',
            u'first_name': u'editou',
            u'last_name': u'editou',
        }
예제 #14
0
    def setUp(self):
        self.url = reverse('members-form')
        self.user = create_user_with_member(first_name='test',
                                            last_name='fake')
        self.client.login(username='******', password='******')
        self.response = self.client.get(self.url)
        self.dom = lhtml.fromstring(self.response.content)

        self.data = {
            u'category': u'1',
            u'location': u'editou',
            u'organization': u'editou',
            u'relation_with_community': u'editou',
            u'phone': u'12-1212-1212',
            u'cpf': u'71763224490',
            u'state': u'editou',
            u'address': u'address',
            u'partner': u'',
            u'mailing': u'',
            u'email': u'*****@*****.**',
            u'first_name': u'editou',
            u'last_name': u'editou',
        }
예제 #15
0
    def setUp(self):
        category = Category.objects.get(id=2)
        create_user_with_member(first_name='teste', last_name='teste')
        create_user_with_member(first_name='dolor', last_name='sit')
        create_user_with_member(first_name='lorem',
                                last_name='ipsum',
                                category=category)
        create_user_with_member(first_name='amet',
                                last_name='consectetur',
                                category=category)
        create_user_with_member(first_name='python',
                                last_name='long name user',
                                category=category)
        create_user_with_member(first_name='temaki',
                                last_name='de_frango',
                                category=category)

        members = [
            Member.objects.filter(user__first_name=name).first()
            for name in ('teste', 'dolor', 'lorem', 'amet', 'python')
        ]

        payment_type = PaymentType.objects.create(category=category,
                                                  price=50.0,
                                                  duration=10)

        for idx, member in enumerate(members):
            date = timezone.now()
            valid_until = date + timedelta(days=365)
            Payment.objects.create(member=member,
                                   type=payment_type,
                                   date=date,
                                   valid_until=valid_until)

        self.url = reverse('members-list')
        self.response = self.client.get(self.url)
예제 #16
0
 def setUp(self):
     self.url = reverse('members-dashboard')
     self.user = create_user_with_member(first_name='test', last_name='fake')
     self.client.login(username='******', password='******')
     self.response = self.client.get(self.url)