test: fix shift type not found (#24929)

This commit is contained in:
Sagar Vora 2021-03-17 23:25:04 +05:30 committed by GitHub
parent 52bbd4e182
commit 500f54e515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -7,6 +7,8 @@ import frappe
import unittest
from frappe.utils import nowdate, add_days
test_dependencies = ["Shift Type"]
class TestShiftRequest(unittest.TestCase):
def setUp(self):
for doctype in ["Shift Request", "Shift Assignment"]:
@ -46,4 +48,4 @@ def set_shift_approver(department):
department_doc = frappe.get_doc("Department", department)
department_doc.append('shift_request_approver',{'approver': "test1@example.com"})
department_doc.save()
department_doc.reload()
department_doc.reload()

View File

@ -0,0 +1,8 @@
[
{
"doctype": "Shift Type",
"name": "Day Shift",
"start_time": "9:00:00",
"end_time": "18:00:00"
}
]

View File

@ -7,14 +7,4 @@ import frappe
import unittest
class TestShiftType(unittest.TestCase):
def test_make_shift_type(self):
if frappe.db.exists("Shift Type", "Day Shift"):
return
shift_type = frappe.get_doc({
"doctype": "Shift Type",
"name": "Day Shift",
"start_time": "9:00:00",
"end_time": "18:00:00"
})
shift_type.insert()
pass