replace pytest by unittest
This commit is contained in:
parent
bf1447a3a9
commit
3eb1b86246
4 changed files with 107 additions and 86 deletions
22
tests/test_form.py
Normal file
22
tests/test_form.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import unittest
|
||||
|
||||
from stacosys.interface import form
|
||||
|
||||
|
||||
class FormInterfaceTestCase(unittest.TestCase):
|
||||
|
||||
def test_check_form_data_ok(self):
|
||||
d = {"url": "/", "message": "", "site": "", "remarque": "", "author": "", "token": "", "email": ""}
|
||||
self.assertTrue(form.check_form_data(d))
|
||||
d = {"url": "/"}
|
||||
self.assertTrue(form.check_form_data(d))
|
||||
d = {}
|
||||
self.assertTrue(form.check_form_data(d))
|
||||
|
||||
def test_check_form_data_ko(self):
|
||||
d = {"url": "/", "message": "", "site": "", "remarque": "", "author": "", "token": "", "email": "", "bonus": ""}
|
||||
self.assertFalse(form.check_form_data(d))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue