[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] 03/05: remove dedicated testcase for admin int
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] 03/05: remove dedicated testcase for admin interface |
Date: |
Wed, 10 May 2017 16:22:06 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
commit 33360c41ecf195322176495a2ed0b35f20cb40cb
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed May 10 13:51:16 2017 +0200
remove dedicated testcase for admin interface
---
Makefile.am | 4 +--
talerbank/app/tests.py | 37 +++++++++++++++++++++++++
talerbank/app/tests_admin.py | 64 --------------------------------------------
3 files changed, 38 insertions(+), 67 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 1d91bac..b1b0d7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,8 +14,7 @@ pkgcfg_DATA = \
bank.conf
pkgdata_DATA = \
- bank.wsgi \
- bank-admin.wsgi
+ bank.wsgi
# link package under prefix to source tree
install-dev:
@@ -23,7 +22,6 @@ install-dev:
check:
@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 130aba2..91e3191 100644
--- a/talerbank/app/tests.py
+++ b/talerbank/app/tests.py
@@ -201,3 +201,40 @@ class DebitTestCase(TestCase):
tmp["value"] = 1
self.assertEqual(0, amounts.amount_cmp(ub0.balance_obj, tmp))
+
+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):
+ User.objects.all().delete()
+ BankAccount.objects.all().delete()
+
+ def test_add_incoming(self):
+ c = Client()
+ data = '{"auth": {"type": "basic"}, \
+ "credit_account": 1, \
+ "wtid": "TESTWTID", \
+ "exchange_url": "https://exchange.test", \
+ "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, **{"HTTP_X_TALER_BANK_USERNAME":
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
+ logger.info(response.content.decode("utf-8"))
+ self.assertEqual(200, response.status_code)
diff --git a/talerbank/app/tests_admin.py b/talerbank/app/tests_admin.py
deleted file mode 100644
index 950fdc2..0000000
--- a/talerbank/app/tests_admin.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# This file is part of TALER
-# (C) 2014, 2015, 2016 INRIA
-#
-# TALER is free software; you can redistribute it and/or modify it under the
-# terms of the GNU Affero General Public License as published by the Free
Software
-# Foundation; either version 3, or (at your option) any later version.
-#
-# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
-#
-# @author Marcello Stanisci
-
-from django.test import TestCase, Client
-from django.core.urlresolvers import reverse
-from django.conf import settings
-from django.contrib.auth.models import User
-from .models import BankAccount
-from . import urlsadmin, urls
-
-import logging
-
-logger = logging.getLogger(__name__)
-
-
-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):
- User.objects.all().delete()
- BankAccount.objects.all().delete()
-
- def test_add_incoming(self):
- c = Client()
- data = '{"auth": {"type": "basic"}, \
- "credit_account": 1, \
- "wtid": "TESTWTID", \
- "exchange_url": "https://exchange.test", \
- "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, **{"HTTP_X_TALER_BANK_USERNAME":
"user_user", "HTTP_X_TALER_BANK_PASSWORD": "user_password"})
- logger.info(response.content.decode("utf-8"))
- self.assertEqual(200, response.status_code)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-bank] branch master updated (8e7202e -> 58127cb), gnunet, 2017/05/10
- [GNUnet-SVN] [taler-bank] 04/05: fix +n for 'delta', gnunet, 2017/05/10
- [GNUnet-SVN] [taler-bank] 05/05: fix /history test, as moving admin test into the other tests file altered the way row_ids are defined during the test run., gnunet, 2017/05/10
- [GNUnet-SVN] [taler-bank] 03/05: remove dedicated testcase for admin interface,
gnunet <=
- [GNUnet-SVN] [taler-bank] 02/05: still on removing admin interface, gnunet, 2017/05/10
- [GNUnet-SVN] [taler-bank] 01/05: towards removing the 'admin' interface, gnunet, 2017/05/10