Fix tests

This commit is contained in:
Ludovic Stephan 2019-11-29 15:33:03 +01:00
parent 361ad46be4
commit 85aa56d030
2 changed files with 13 additions and 6 deletions

View file

@ -4088,15 +4088,22 @@ class HistoryJSONViewTests(ViewTestCaseMixin, TestCase):
class AccountReadJSONViewTests(ViewTestCaseMixin, TestCase):
url_name = "kfet.account.read.json"
url_expected = "/k-fet/accounts/read.json"
http_methods = ["POST"]
http_methods = ["GET"]
auth_user = "team"
auth_forbidden = [None, "user"]
@property
def url_kwargs(self):
return {"trigramme": self.accounts["user"].trigramme}
@property
def url_expected(self):
return "/k-fet/accounts/{}/.json".format(self.accounts["user"].trigramme)
def test_ok(self):
r = self.client.post(self.url, {"trigramme": "000"})
r = self.client.get(self.url)
self.assertEqual(r.status_code, 200)
content = json.loads(r.content.decode("utf-8"))