mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
upgraded test_runner, now can run multiple tests
This commit is contained in:
@@ -21,4 +21,3 @@ class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
test_records = [[{"doctype":"Branch", "branch":"_Test Branch"}]]
|
||||
1
hr/doctype/branch/test_branch.py
Normal file
1
hr/doctype/branch/test_branch.py
Normal file
@@ -0,0 +1 @@
|
||||
test_records = [[{"doctype":"Branch", "branch":"_Test Branch"}]]
|
||||
@@ -20,9 +20,4 @@ import webnotes
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
test_records = [
|
||||
[{"doctype":"Department", "department_name":"_Test Department"}],
|
||||
[{"doctype":"Department", "department_name":"_Test Department with Block List",
|
||||
"holiday_block_list": "_Test Holiday Block List"}],
|
||||
]
|
||||
|
||||
5
hr/doctype/department/test_department.py
Normal file
5
hr/doctype/department/test_department.py
Normal file
@@ -0,0 +1,5 @@
|
||||
test_records = [
|
||||
[{"doctype":"Department", "department_name":"_Test Department"}],
|
||||
[{"doctype":"Department", "department_name":"_Test Department with Block List",
|
||||
"holiday_block_list": "_Test Holiday Block List"}],
|
||||
]
|
||||
@@ -21,4 +21,3 @@ class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]]
|
||||
1
hr/doctype/designation/test_designation.py
Normal file
1
hr/doctype/designation/test_designation.py
Normal file
@@ -0,0 +1 @@
|
||||
test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]]
|
||||
@@ -128,26 +128,3 @@ class DocType:
|
||||
if self.doc.status == 'Left' and not self.doc.relieving_date:
|
||||
msgprint("Please enter relieving date.")
|
||||
raise Exception
|
||||
|
||||
test_records = [[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Female",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test@erpnext.com"
|
||||
}],
|
||||
[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee 1",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Male",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test1@erpnext.com"
|
||||
}]]
|
||||
22
hr/doctype/employee/test_employee.py
Normal file
22
hr/doctype/employee/test_employee.py
Normal file
@@ -0,0 +1,22 @@
|
||||
test_records = [[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Female",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test@erpnext.com"
|
||||
}],
|
||||
[{
|
||||
"doctype":"Employee",
|
||||
"employee_name": "_Test Employee 1",
|
||||
"naming_series": "_T-Employee-",
|
||||
"date_of_joining": "2010-01-01",
|
||||
"date_of_birth": "1980-01-01",
|
||||
"gender": "Male",
|
||||
"status": "Active",
|
||||
"company": "_Test Company",
|
||||
"user_id": "test1@erpnext.com"
|
||||
}]]
|
||||
@@ -20,6 +20,4 @@ import webnotes
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
test_records = [[{"doctype":"Employment Type",
|
||||
"employee_type_name": "_Test Employment Type"}]]
|
||||
|
||||
2
hr/doctype/employment_type/test_employment_type.py
Normal file
2
hr/doctype/employment_type/test_employment_type.py
Normal file
@@ -0,0 +1,2 @@
|
||||
test_records = [[{"doctype":"Employment Type",
|
||||
"employee_type_name": "_Test Employment Type"}]]
|
||||
@@ -21,4 +21,3 @@ class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
test_records = [[{"doctype":"Grade", "grade_name":"Test Grade"}]]
|
||||
1
hr/doctype/grade/test_grade.py
Normal file
1
hr/doctype/grade/test_grade.py
Normal file
@@ -0,0 +1 @@
|
||||
test_records = [[{"doctype":"Grade", "grade_name":"_Test Grade"}]]
|
||||
@@ -20,23 +20,3 @@ class DocType:
|
||||
webnotes.msgprint(_("Date is repeated") + ":" + d.block_date, raise_exception=1)
|
||||
dates.append(d.block_date)
|
||||
|
||||
test_records = [[{
|
||||
"doctype":"Holiday Block List",
|
||||
"holiday_block_list_name": "_Test Holiday Block List",
|
||||
"year": "_Test Fiscal Year 2013",
|
||||
"company": "_Test Company"
|
||||
}, {
|
||||
"doctype": "Holiday Block List Date",
|
||||
"parent": "_Test Holiday Block List",
|
||||
"parenttype": "Holiday Block List",
|
||||
"parentfield": "holiday_block_list_dates",
|
||||
"block_date": "2013-01-02",
|
||||
"reason": "First work day"
|
||||
}, {
|
||||
"doctype": "Holiday Block List Allow",
|
||||
"parent": "_Test Holiday Block List",
|
||||
"parenttype": "Holiday Block List",
|
||||
"parentfield": "holiday_block_list_allowed",
|
||||
"allow_user": "test1@erpnext.com",
|
||||
}
|
||||
]]
|
||||
20
hr/doctype/holiday_block_list/test_holiday_block_list.py
Normal file
20
hr/doctype/holiday_block_list/test_holiday_block_list.py
Normal file
@@ -0,0 +1,20 @@
|
||||
test_records = [[{
|
||||
"doctype":"Holiday Block List",
|
||||
"holiday_block_list_name": "_Test Holiday Block List",
|
||||
"year": "_Test Fiscal Year 2013",
|
||||
"company": "_Test Company"
|
||||
}, {
|
||||
"doctype": "Holiday Block List Date",
|
||||
"parent": "_Test Holiday Block List",
|
||||
"parenttype": "Holiday Block List",
|
||||
"parentfield": "holiday_block_list_dates",
|
||||
"block_date": "2013-01-02",
|
||||
"reason": "First work day"
|
||||
}, {
|
||||
"doctype": "Holiday Block List Allow",
|
||||
"parent": "_Test Holiday Block List",
|
||||
"parenttype": "Holiday Block List",
|
||||
"parentfield": "holiday_block_list_allowed",
|
||||
"allow_user": "test1@erpnext.com",
|
||||
}
|
||||
]]
|
||||
@@ -89,16 +89,3 @@ class DocType:
|
||||
def update_default_holiday_list(self):
|
||||
webnotes.conn.sql("""update `tabHoliday List` set is_default = 0
|
||||
where ifnull(is_default, 0) = 1 and fiscal_year = %s""", (self.doc.fiscal_year,))
|
||||
|
||||
test_records = [[{
|
||||
"doctype": "Holiday List",
|
||||
"holiday_list_name": "_Test Holiday List",
|
||||
"fiscal_year": "_Test Fiscal Year 2013"
|
||||
}, {
|
||||
"doctype": "Holiday",
|
||||
"parent": "_Test Holiday List",
|
||||
"parenttype": "Holiday List",
|
||||
"parentfield": "holiday_list_details",
|
||||
"holiday_date": "2013-01-01",
|
||||
"description": "New Year"
|
||||
}]]
|
||||
|
||||
12
hr/doctype/holiday_list/test_holiday_list.py
Normal file
12
hr/doctype/holiday_list/test_holiday_list.py
Normal file
@@ -0,0 +1,12 @@
|
||||
test_records = [[{
|
||||
"doctype": "Holiday List",
|
||||
"holiday_list_name": "_Test Holiday List",
|
||||
"fiscal_year": "_Test Fiscal Year 2013"
|
||||
}, {
|
||||
"doctype": "Holiday",
|
||||
"parent": "_Test Holiday List",
|
||||
"parenttype": "Holiday List",
|
||||
"parentfield": "holiday_list_details",
|
||||
"holiday_date": "2013-01-01",
|
||||
"description": "New Year"
|
||||
}]]
|
||||
@@ -1,9 +1,6 @@
|
||||
import sys
|
||||
import webnotes
|
||||
import unittest
|
||||
|
||||
if __name__=="__main__":
|
||||
sys.path.extend([".", "app", "lib"])
|
||||
|
||||
from hr.doctype.leave_application.leave_application import LeaveDayBlockedError
|
||||
|
||||
class TestLeaveApplication(unittest.TestCase):
|
||||
@@ -54,13 +51,3 @@ test_records = [
|
||||
"employee": "_T-Employee-0001",
|
||||
"company": "_Test Company"
|
||||
}]]
|
||||
|
||||
if __name__=="__main__":
|
||||
import webnotes
|
||||
webnotes.connect()
|
||||
|
||||
from webnotes.test_runner import make_test_records
|
||||
make_test_records("Leave Application")
|
||||
|
||||
unittest.main()
|
||||
|
||||
|
||||
@@ -20,10 +20,4 @@ import webnotes
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
test_records = [
|
||||
[{
|
||||
"leave_type_name": "_Test Leave Type",
|
||||
"doctype": "Leave Type"
|
||||
}]
|
||||
]
|
||||
|
||||
6
hr/doctype/leave_type/test_leave_type.py
Normal file
6
hr/doctype/leave_type/test_leave_type.py
Normal file
@@ -0,0 +1,6 @@
|
||||
test_records = [
|
||||
[{
|
||||
"leave_type_name": "_Test Leave Type",
|
||||
"doctype": "Leave Type"
|
||||
}]
|
||||
]
|
||||
Reference in New Issue
Block a user