Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
f862eff8
Commit
f862eff8
authored
Feb 12, 2020
by
Job Doesburg
Browse files
Merge branch 'add-payable-interface' into 'master'
Add base class for all payable objects Closes
#1010
See merge request
!1493
parents
6a48da16
a6eb0ac8
Changes
2
Hide whitespace changes
Inline
Side-by-side
website/payments/models.py
View file @
f862eff8
...
...
@@ -11,6 +11,24 @@ from localflavor.generic.countries.sepa import IBAN_SEPA_COUNTRIES
from
localflavor.generic.models
import
IBANField
,
BICField
class
Payable
:
@
property
def
payment_amount
(
self
):
raise
NotImplementedError
@
property
def
payment_topic
(
self
):
raise
NotImplementedError
@
property
def
payment_notes
(
self
):
raise
NotImplementedError
@
property
def
payment_payer
(
self
):
raise
NotImplementedError
class
Payment
(
models
.
Model
):
"""
Describes a payment
...
...
website/payments/tests/test_models.py
View file @
f862eff8
...
...
@@ -4,7 +4,31 @@ from django.utils import timezone
from
freezegun
import
freeze_time
from
members.models
import
Member
from
payments.models
import
Payment
,
BankAccount
from
payments.models
import
Payment
,
BankAccount
,
Payable
class
PayableTest
(
TestCase
):
"""Tests for the Payable class"""
def
test_payment_amount_not_implemented
(
self
):
p
=
Payable
()
with
self
.
assertRaises
(
NotImplementedError
):
_
=
p
.
payment_amount
def
test_payment_topic_not_implemented
(
self
):
p
=
Payable
()
with
self
.
assertRaises
(
NotImplementedError
):
_
=
p
.
payment_topic
def
test_payment_notes_not_implemented
(
self
):
p
=
Payable
()
with
self
.
assertRaises
(
NotImplementedError
):
_
=
p
.
payment_notes
def
test_payment_payer_not_implemented
(
self
):
p
=
Payable
()
with
self
.
assertRaises
(
NotImplementedError
):
_
=
p
.
payment_payer
@
override_settings
(
SUSPEND_SIGNALS
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment