forked from DGNum/gestioCOF
add token check to raw_open edit view
This commit is contained in:
parent
98f5f0c391
commit
19847ac9d8
4 changed files with 16 additions and 3 deletions
|
@ -136,7 +136,10 @@ class OpenKfetViewsTest(ChannelTestCase):
|
|||
def test_door(self):
|
||||
"""Edit raw_status."""
|
||||
for sent, expected in [(1, True), (0, False)]:
|
||||
resp = Client().post('/k-fet/open/raw_open', {'raw_open': sent})
|
||||
resp = Client().post('/k-fet/open/raw_open', {
|
||||
'raw_open': sent,
|
||||
'token': 'plop',
|
||||
})
|
||||
self.assertEqual(200, resp.status_code)
|
||||
self.assertEqual(expected, kfet_open.raw_open)
|
||||
|
||||
|
@ -254,7 +257,10 @@ class OpenKfetScenarioTest(ChannelTestCase):
|
|||
self.ws_connect(self.r_c_ws)
|
||||
|
||||
# door sent "I'm open!"
|
||||
self.c.post('/k-fet/open/raw_open', {'raw_open': True})
|
||||
self.c.post('/k-fet/open/raw_open', {
|
||||
'raw_open': True,
|
||||
'token': 'plop',
|
||||
})
|
||||
|
||||
# anonymous user agree
|
||||
msg = self.c_ws.receive(json=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue