mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
test: fix tests failing due to dependent state (#51187)
* test: Use fixture instead of hardcoded employee * test: create user before assigning
This commit is contained in:
@@ -32,10 +32,9 @@ class TestJobCard(ERPNextTestSuite):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
# used in job card time log
|
||||
cls.make_employees()
|
||||
|
||||
def setUp(self):
|
||||
self.make_employees() # used in job card time log
|
||||
self.make_bom_for_jc_tests()
|
||||
self.transfer_material_against: Literal["Work Order", "Job Card"] = "Work Order"
|
||||
self.source_warehouse = None
|
||||
@@ -128,7 +127,7 @@ class TestJobCard(ERPNextTestSuite):
|
||||
jc1 = frappe.get_last_doc("Job Card", {"work_order": self.work_order.name})
|
||||
jc2 = frappe.get_last_doc("Job Card", {"work_order": wo2.name})
|
||||
|
||||
employee = "_T-Employee-00001" # from test records
|
||||
employee = self.employees[0].name
|
||||
|
||||
jc1.append(
|
||||
"time_logs",
|
||||
|
||||
@@ -219,6 +219,7 @@ class TestIssue(TestSetUp):
|
||||
frappe.flags.current_time = get_datetime("2021-11-01 19:00")
|
||||
|
||||
issue = make_issue(frappe.flags.current_time, index=1)
|
||||
create_user("test@admin.com")
|
||||
create_communication(issue.name, "test@example.com", "Received", frappe.flags.current_time)
|
||||
add_assignment({"doctype": issue.doctype, "name": issue.name, "assign_to": ["test@admin.com"]})
|
||||
issue.reload()
|
||||
|
||||
Reference in New Issue
Block a user