forked from DGNum/gestioCOF
core -- Apply black + isort to all files
This commit is contained in:
parent
104e71dcf6
commit
fdd2b35289
196 changed files with 10727 additions and 8365 deletions
|
@ -1,14 +1,13 @@
|
|||
from unittest.mock import patch
|
||||
|
||||
from django.test import TestCase, Client
|
||||
from django.contrib.auth.models import User, Permission
|
||||
from django.contrib.auth.models import Permission, User
|
||||
from django.test import Client, TestCase
|
||||
|
||||
from kfet.models import Account, Article, ArticleCategory
|
||||
|
||||
|
||||
class TestStats(TestCase):
|
||||
|
||||
@patch('gestioncof.signals.messages')
|
||||
@patch("gestioncof.signals.messages")
|
||||
def test_user_stats(self, mock_messages):
|
||||
"""
|
||||
Checks that we can get the stat-related pages without any problem.
|
||||
|
@ -28,8 +27,7 @@ class TestStats(TestCase):
|
|||
Account.objects.create(trigramme="BAR", cofprofile=user2.profile)
|
||||
|
||||
article = Article.objects.create(
|
||||
name="article",
|
||||
category=ArticleCategory.objects.create(name="C")
|
||||
name="article", category=ArticleCategory.objects.create(name="C")
|
||||
)
|
||||
|
||||
# Each user have its own client
|
||||
|
@ -43,12 +41,17 @@ class TestStats(TestCase):
|
|||
user_urls = [
|
||||
"/k-fet/accounts/FOO/stat/operations/list",
|
||||
"/k-fet/accounts/FOO/stat/operations?{}".format(
|
||||
'&'.join(["scale=day",
|
||||
"types=['purchase']",
|
||||
"scale_args={'n_steps':+7,+'last':+True}",
|
||||
"format=json"])),
|
||||
"&".join(
|
||||
[
|
||||
"scale=day",
|
||||
"types=['purchase']",
|
||||
"scale_args={'n_steps':+7,+'last':+True}",
|
||||
"format=json",
|
||||
]
|
||||
)
|
||||
),
|
||||
"/k-fet/accounts/FOO/stat/balance/list",
|
||||
"/k-fet/accounts/FOO/stat/balance?format=json"
|
||||
"/k-fet/accounts/FOO/stat/balance?format=json",
|
||||
]
|
||||
for url in user_urls:
|
||||
resp = client.get(url)
|
||||
|
@ -60,7 +63,7 @@ class TestStats(TestCase):
|
|||
# receives a Redirect response
|
||||
articles_urls = [
|
||||
"/k-fet/articles/{}/stat/sales/list".format(article.pk),
|
||||
"/k-fet/articles/{}/stat/sales".format(article.pk)
|
||||
"/k-fet/articles/{}/stat/sales".format(article.pk),
|
||||
]
|
||||
for url in articles_urls:
|
||||
resp = client.get(url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue