[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] branch master updated: Splitting testscases ac
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] branch master updated: Splitting testscases according to normal and admin instance. |
Date: |
Thu, 02 Feb 2017 15:28:02 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
The following commit(s) were added to refs/heads/master by this push:
new a471b6f Splitting testscases according to normal and admin instance.
a471b6f is described below
commit a471b6f19549d0f53fa2724fa26ba59b66c7ce57
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Feb 2 15:27:48 2017 +0100
Splitting testscases according to normal and admin instance.
---
Makefile.am | 3 +-
talerbank/app/tests.py | 26 ---------------
talerbank/app/{tests.py => tests_admin.py} | 53 ++----------------------------
3 files changed, 4 insertions(+), 78 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 05534e0..21d25d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,8 @@ install-dev:
@pip3 install -e . --install-option="address@hidden@"
check:
- @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" && python3 -m django test
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" && python3 -m django test talerbank.app.tests
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings_admin"
TALER_PREFIX="@prefix@" && python3 -m django test talerbank.app.tests_admin
# install into prefix
install-exec-hook:
diff --git a/talerbank/app/tests.py b/talerbank/app/tests.py
index a5af7c9..7b437f1 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -75,29 +75,3 @@ class LoginTestCase(TestCase):
"password": "test_password"},
follow=True)
self.assertIn(("/profile", 302), response.redirect_chain)
-
-class AddIncomingTestCase(TestCase):
- """Test money transfer's API"""
-
- def setUp(self):
- bank = User.objects.create_user(username="bank_user",
- password="bank_password")
- bank_account = BankAccount(user=bank,
- currency=settings.TALER_CURRENCY)
- user = User.objects.create_user(username="user_user",
- password="user_password")
- user_account = BankAccount(user=user,
- currency=settings.TALER_CURRENCY)
- bank_account.save()
- user_account.save()
-
- def tearDown(self):
- clearDb()
-
- def test_add_incoming(self):
- c = Client()
- data = '{"debit_account":1, "credit_account":2, "wtid":"TESTWTID",
"amount":{"value":1, "fraction":0, "currency":"%s"}}' % settings.TALER_CURRENCY
- response = c.post(reverse("add-incoming", urlconf=urlsadmin),
- data=data,
- content_type="application/json",
- follow=True)
diff --git a/talerbank/app/tests.py b/talerbank/app/tests_admin.py
similarity index 57%
copy from talerbank/app/tests.py
copy to talerbank/app/tests_admin.py
index a5af7c9..32ab545 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests_admin.py
@@ -25,56 +25,6 @@ import logging
logger = logging.getLogger(__name__)
-def clearDb():
- User.objects.all().delete()
- BankAccount.objects.all().delete()
-
-
-class RegisterTestCase(TestCase):
- """User registration"""
-
- def setUp(self):
- bank = User.objects.create_user(username='Bank')
- ba = BankAccount(user=bank, currency=settings.TALER_CURRENCY)
- ba.account_no = 1
- ba.save()
-
- def tearDown(self):
- clearDb()
-
- def test_register(self):
- c = Client()
- response = c.post(reverse("register", urlconf=urls),
- {"username": "test_register",
- "password": "test_register"},
- follow=True)
- self.assertIn(("/profile", 302), response.redirect_chain)
- # this assertion tests "/profile""s view
- self.assertEqual(200, response.status_code)
-
-
-class LoginTestCase(TestCase):
- """User login"""
-
- def setUp(self):
- user = User.objects.create_user(username="test_user",
- password="test_password")
- user_account = BankAccount(user=user,
- currency=settings.TALER_CURRENCY)
- user_account.save()
-
-
- def tearDown(self):
- clearDb()
-
-
- def test_login(self):
- c = Client()
- response = c.post(reverse("login", urlconf=urls),
- {"username": "test_user",
- "password": "test_password"},
- follow=True)
- self.assertIn(("/profile", 302), response.redirect_chain)
class AddIncomingTestCase(TestCase):
"""Test money transfer's API"""
@@ -92,7 +42,8 @@ class AddIncomingTestCase(TestCase):
user_account.save()
def tearDown(self):
- clearDb()
+ User.objects.all().delete()
+ BankAccount.objects.all().delete()
def test_add_incoming(self):
c = Client()
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-bank] branch master updated: Splitting testscases according to normal and admin instance.,
gnunet <=