def setUp(self):
     self.owner = UserFactory(username='******')
     self.not_owner = UserFactory(username='******')
     self.banktransactiontags = [
         BankTransactionTagFactory(owner=self.owner),
         BankTransactionTagFactory(owner=self.not_owner),
     ]
    def test_owner_delete_signal(self):

        owner = UserFactory()
        bankaccount = BankAccountFactory(owners=[owner])

        owner.delete()
        with self.assertRaises(BankAccount.DoesNotExist):
            bankaccount.refresh_from_db()
 def setUpTestData(cls):
     cls.owner = UserFactory(username='******')
     cls.not_owner = UserFactory(username='******',
                                 user_permissions='staff')
     cls.superowner = UserFactory(username='******',
                                  user_permissions='admin')
     cls.bankaccount = BankAccountFactory(
         owners=[cls.owner, cls.superowner])
    def test_delete_owner(self):

        owner = UserFactory(username='******')
        banktransactiontag = BankTransactionTagFactory(owner=owner)

        owner.delete()
        with self.assertRaises(BankTransactionTag.DoesNotExist):
            banktransactiontag.refresh_from_db()
Beispiel #5
0
 def setUpTestData(cls):
     cls.owner = UserFactory(username='******')
     cls.superowner = UserFactory(username='******',
                                  user_permissions='admin')
     cls.bankaccount = BankAccountFactory(
         owners=[cls.owner, cls.superowner],
         balance_initial=Decimal('10.15'),
     )
     cls.banktransaction = BankTransactionFactory(
         bankaccount=cls.bankaccount)
Beispiel #6
0
 def setUpTestData(cls):
     cls.owner = UserFactory(username='******')
     cls.superowner = UserFactory(username='******',
                                  user_permissions='admin')
     cls.bankaccount = BankAccountFactory(
         owners=[cls.owner, cls.superowner])
     cls.banktransactiontags = [
         BankTransactionTagFactory(owner=cls.owner),
         BankTransactionTagFactory(owner=cls.owner),
         BankTransactionTagFactory(owner=cls.superowner),
         BankTransactionTagFactory(),
     ]
     cls.url = reverse('banktransactions:list',
                       kwargs={'bankaccount_pk': cls.bankaccount.pk})
 def setUpTestData(cls):
     cls.owner = UserFactory(username='******')
     cls.bankaccount = BankAccountFactory(owners=[cls.owner])
     cls.banktransactiontags = [
         BankTransactionTagFactory(owner=cls.owner),
         BankTransactionTagFactory(owner=cls.owner),
         BankTransactionTagFactory(owner=cls.owner),
     ]
    def test_get_user_tags_with_bankaccount(self):

        superowner = UserFactory(username='******',
                                 user_permissions='admin')
        banktransactiontag = BankTransactionTagFactory(owner=superowner)
        BankAccountFactory(owners=[self.owner, superowner])

        tags = BankTransactionTag.objects.get_user_tags_queryset(self.owner)
        self.assertListEqual([
            self.banktransactiontags[0].pk,
            banktransactiontag.pk,
        ], sorted([tag.pk for tag in tags]))
 def setUpTestData(cls):
     cls.owner = UserFactory(username='******')
     cls.bankaccount = BankAccountFactory(owners=[cls.owner])
Beispiel #10
0
 def setUpTestData(cls):
     cls.owner = UserFactory(username='******')
     cls.superowner = UserFactory(username='******',
                                  user_permissions='admin')