debug(tests): test_workflow

This commit is contained in:
Rushabh Mehta 2020-08-17 09:56:45 +05:30
parent 7ee1fe3caf
commit 6535751e1d
5 changed files with 6 additions and 2 deletions

View file

@ -2,6 +2,7 @@
"db_host": "localhost",
"db_name": "test_frappe_consumer",
"db_password": "test_frappe",
"allow_tests": true,
"db_type": "mariadb",
"auto_email_id": "test@example.com",
"mail_server": "smtp.example.com",

View file

@ -3,6 +3,7 @@
"db_name": "test_frappe_consumer",
"db_password": "test_frappe",
"db_type": "postgres",
"allow_tests": true,
"auto_email_id": "test@example.com",
"mail_server": "smtp.example.com",
"mail_login": "test@example.com",

View file

@ -2,6 +2,7 @@
"db_host": "localhost",
"db_name": "test_frappe_producer",
"db_password": "test_frappe",
"allow_tests": true,
"db_type": "mariadb",
"auto_email_id": "test@example.com",
"mail_server": "smtp.example.com",

View file

@ -3,6 +3,7 @@
"db_name": "test_frappe_producer",
"db_password": "test_frappe",
"db_type": "postgres",
"allow_tests": true,
"auto_email_id": "test@example.com",
"mail_server": "smtp.example.com",
"mail_login": "test@example.com",

View file

@ -20,6 +20,7 @@ class TestWorkflow(unittest.TestCase):
frappe.set_user('Administrator')
def tearDown(self):
frappe.print_sql(False)
self.workflow.db_set('is_active', 0)
def test_default_condition(self):
@ -33,11 +34,10 @@ class TestWorkflow(unittest.TestCase):
def test_approve(self, doc=None):
'''test simple workflow'''
frappe.print_sql(True)
todo = doc or self.test_default_condition()
frappe.print_sql(True)
apply_workflow(todo, 'Approve')
frappe.print_sql(False)
# default condition is set
self.assertEqual(todo.workflow_state, 'Approved')
self.assertEqual(todo.status, 'Closed')