Sfoglia il codice sorgente

debug(tests): test_workflow

version-14
Rushabh Mehta 4 anni fa
parent
commit
6535751e1d
5 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. +1
    -0
      .travis/consumer_db/mariadb.json
  2. +1
    -0
      .travis/consumer_db/postgres.json
  3. +1
    -0
      .travis/producer_db/mariadb.json
  4. +1
    -0
      .travis/producer_db/postgres.json
  5. +2
    -2
      frappe/workflow/doctype/workflow/test_workflow.py

+ 1
- 0
.travis/consumer_db/mariadb.json Vedi 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",


+ 1
- 0
.travis/consumer_db/postgres.json Vedi 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",


+ 1
- 0
.travis/producer_db/mariadb.json Vedi 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",


+ 1
- 0
.travis/producer_db/postgres.json Vedi 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",


+ 2
- 2
frappe/workflow/doctype/workflow/test_workflow.py Vedi 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')


Caricamento…
Annulla
Salva