Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
2fca548e
Commit
2fca548e
authored
Sep 20, 2018
by
Soldat
🤦🏻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 1 day cotiz
parent
be36b7f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
sith/settings.py
sith/settings.py
+5
-0
subscription/migrations/0009_auto_20180920_1421.py
subscription/migrations/0009_auto_20180920_1421.py
+20
-0
subscription/tests.py
subscription/tests.py
+10
-0
No files found.
sith/settings.py
View file @
2fca548e
...
...
@@ -512,6 +512,11 @@ SITH_SUBSCRIPTIONS = {
'name'
:
_
(
'Six weeks for free'
),
'price'
:
0
,
'duration'
:
0.23
,
},
'un-jour'
:
{
'name'
:
_
(
'Un jour'
),
'price'
:
0
,
'duration'
:
0.00555333
,
}
# To be completed....
}
...
...
subscription/migrations/0009_auto_20180920_1421.py
0 → 100644
View file @
2fca548e
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-20 12:21
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'subscription'
,
'0008_auto_20180831_2016'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'subscription'
,
name
=
'subscription_type'
,
field
=
models
.
CharField
(
choices
=
[(
'amicale/doceo'
,
'Amicale/DOCEO member'
),
(
'assidu'
,
'Assidu member'
),
(
'benevoles-euroks'
,
"Eurok's volunteer"
),
(
'crous'
,
'CROUS member'
),
(
'cursus-alternant'
,
'Alternating cursus'
),
(
'cursus-branche'
,
'Branch cursus'
),
(
'cursus-tronc-commun'
,
'Common core cursus'
),
(
'deux-mois-essai'
,
'Two months for free'
),
(
'deux-semestres'
,
'Two semesters'
),
(
'membre-honoraire'
,
'Honorary member'
),
(
'reseau-ut'
,
'UT network member'
),
(
'sbarro/esta'
,
'Sbarro/ESTA member'
),
(
'six-semaines-essai'
,
'Six weeks for free'
),
(
'un-jour'
,
'Un jour'
),
(
'un-semestre'
,
'One semester'
),
(
'un-semestre-welcome'
,
'One semester Welcome Week'
)],
max_length
=
255
,
verbose_name
=
'subscription type'
),
),
]
subscription/tests.py
View file @
2fca548e
...
...
@@ -117,6 +117,16 @@ class SubscriptionIntegrationTest(TestCase):
s
.
save
()
self
.
assertTrue
(
s
.
subscription_end
==
date
(
2017
,
10
,
29
))
def
test_duration_two_months
(
self
):
s
=
Subscription
(
member
=
User
.
objects
.
filter
(
pk
=
self
.
user
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
3
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
])
s
.
subscription_start
=
date
(
2017
,
8
,
29
)
s
.
subscription_end
=
s
.
compute_end
(
duration
=
settings
.
SITH_SUBSCRIPTIONS
[
'un-jour'
][
'duration'
],
start
=
s
.
subscription_start
)
s
.
save
()
self
.
assertTrue
(
s
.
subscription_end
==
date
(
2017
,
8
,
30
))
def
test_duration_three_months
(
self
):
s
=
Subscription
(
member
=
User
.
objects
.
filter
(
pk
=
self
.
user
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
3
],
...
...
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