Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: task test case for project change #1747

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

vishdha
Copy link

@vishdha vishdha commented Oct 6, 2021

  • Fixes Test Case

Traceback/Bug Report:

2021-10-06T10:52:53.6322753Z ======================================================================
2021-10-06T10:52:53.6323590Z ERROR: test_circular_reference (erpnext.projects.doctype.task.test_task.TestTask)
2021-10-06T10:52:53.6325262Z ----------------------------------------------------------------------
2021-10-06T10:52:53.6325795Z Traceback (most recent call last):
2021-10-06T10:52:53.6328445Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 12, in test_circular_reference
2021-10-06T10:52:53.6329684Z     task1 = create_task("_Test Task 1", add_days(nowdate(), -15), add_days(nowdate(), -10))
2021-10-06T10:52:53.6330858Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 150, in create_task
2021-10-06T10:52:53.6331572Z     task.save()
2021-10-06T10:52:53.6332419Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 273, in save
2021-10-06T10:52:53.6333102Z     return self._save(*args, **kwargs)
2021-10-06T10:52:53.6334001Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
2021-10-06T10:52:53.6334671Z     self.insert()
2021-10-06T10:52:53.6335517Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
2021-10-06T10:52:53.6336177Z     self._validate()
2021-10-06T10:52:53.6337054Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in _validate
2021-10-06T10:52:53.6338100Z     self._validate_mandatory()
2021-10-06T10:52:53.6339098Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 751, in _validate_mandatory
2021-10-06T10:52:53.6339813Z     name=self.name))
2021-10-06T10:52:53.6340703Z frappe.exceptions.MandatoryError: [Task, TASK-2021-00007]: projects
2021-10-06T10:52:53.6341303Z 
2021-10-06T10:52:53.6341640Z ======================================================================
2021-10-06T10:52:53.6342498Z ERROR: test_complete_task_with_assignment_closing (erpnext.projects.doctype.task.test_task.TestTask)
2021-10-06T10:52:53.6343656Z ----------------------------------------------------------------------
2021-10-06T10:52:53.6344194Z Traceback (most recent call last):
2021-10-06T10:52:53.6345367Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 100, in test_complete_task_with_assignment_closing
2021-10-06T10:52:53.6346186Z     task.insert()
2021-10-06T10:52:53.6347035Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
2021-10-06T10:52:53.6347688Z     self._validate()
2021-10-06T10:52:53.6348558Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in _validate
2021-10-06T10:52:53.6349249Z     self._validate_mandatory()
2021-10-06T10:52:53.6350206Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 751, in _validate_mandatory
2021-10-06T10:52:53.6350911Z     name=self.name))
2021-10-06T10:52:53.6351795Z frappe.exceptions.MandatoryError: [Task, TASK-2021-00008]: projects
2021-10-06T10:52:53.6352379Z 
2021-10-06T10:52:53.6352714Z ======================================================================
2021-10-06T10:52:53.6353707Z ERROR: test_complete_task_without_assignment_closing (erpnext.projects.doctype.task.test_task.TestTask)
2021-10-06T10:52:53.6355064Z ----------------------------------------------------------------------
2021-10-06T10:52:53.6355607Z Traceback (most recent call last):
2021-10-06T10:52:53.6356805Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 63, in test_complete_task_without_assignment_closing
2021-10-06T10:52:53.6357644Z     task.insert()
2021-10-06T10:52:53.6358492Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
2021-10-06T10:52:53.6359148Z     self._validate()
2021-10-06T10:52:53.6360021Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in _validate
2021-10-06T10:52:53.6360700Z     self._validate_mandatory()
2021-10-06T10:52:53.6361662Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 751, in _validate_mandatory
2021-10-06T10:52:53.6362405Z     name=self.name))
2021-10-06T10:52:53.6363289Z frappe.exceptions.MandatoryError: [Task, TASK-2021-00009]: projects
2021-10-06T10:52:53.6363884Z 
2021-10-06T10:52:53.6364220Z ======================================================================
2021-10-06T10:52:53.6364976Z ERROR: test_overdue (erpnext.projects.doctype.task.test_task.TestTask)
2021-10-06T10:52:53.6366021Z ----------------------------------------------------------------------
2021-10-06T10:52:53.6366548Z Traceback (most recent call last):
2021-10-06T10:52:53.6367557Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 134, in test_overdue
2021-10-06T10:52:53.6368651Z     task = create_task("Testing Overdue", add_days(nowdate(), -10), add_days(nowdate(), -5))
2021-10-06T10:52:53.6369764Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 150, in create_task
2021-10-06T10:52:53.6370481Z     task.save()
2021-10-06T10:52:53.6371314Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 273, in save
2021-10-06T10:52:53.6371985Z     return self._save(*args, **kwargs)
2021-10-06T10:52:53.6372879Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
2021-10-06T10:52:53.6373521Z     self.insert()
2021-10-06T10:52:53.6374469Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
2021-10-06T10:52:53.6375127Z     self._validate()
2021-10-06T10:52:53.6376012Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in _validate
2021-10-06T10:52:53.6376705Z     self._validate_mandatory()
2021-10-06T10:52:53.6377674Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 751, in _validate_mandatory
2021-10-06T10:52:53.6378375Z     name=self.name))
2021-10-06T10:52:53.6379263Z frappe.exceptions.MandatoryError: [Task, TASK-2021-00010]: projects
2021-10-06T10:52:53.6379863Z 
2021-10-06T10:52:53.6380193Z ======================================================================
2021-10-06T10:52:53.6381030Z ERROR: test_reschedule_dependent_task (erpnext.projects.doctype.task.test_task.TestTask)
2021-10-06T10:52:53.6382143Z ----------------------------------------------------------------------
2021-10-06T10:52:53.6382677Z Traceback (most recent call last):
2021-10-06T10:52:53.6384736Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 33, in test_reschedule_dependent_task
2021-10-06T10:52:53.6385670Z     task1 = create_task("_Test Task 1", nowdate(), add_days(nowdate(), 10))
2021-10-06T10:52:53.6386754Z   File "/home/runner/frappe-bench/apps/erpnext/erpnext/projects/doctype/task/test_task.py", line 150, in create_task
2021-10-06T10:52:53.6387444Z     task.save()
2021-10-06T10:52:53.6388280Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 273, in save
2021-10-06T10:52:53.6388967Z     return self._save(*args, **kwargs)
2021-10-06T10:52:53.6389979Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
2021-10-06T10:52:53.6390620Z     self.insert()
2021-10-06T10:52:53.6391477Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
2021-10-06T10:52:53.6392113Z     self._validate()
2021-10-06T10:52:53.6394741Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in _validate
2021-10-06T10:52:53.6411788Z     self._validate_mandatory()
2021-10-06T10:52:53.6413306Z   File "/home/runner/frappe-bench/apps/frappe/frappe/model/document.py", line 751, in _validate_mandatory
2021-10-06T10:52:53.6415265Z     name=self.name))
2021-10-06T10:52:53.6416280Z frappe.exceptions.MandatoryError: [Task, TASK-2021-00011]: projects

Fixes::
Fixed a bunch of test cases for the task. We change workflow for tasks. we have added the projects child table and renamed the project to default project.

Expected Behaviour:

Running "before_tests" hooks
test_circular_reference (erpnext.projects.doctype.task.test_task.TestTask) ... ok
test_complete_task_with_assignment_closing (erpnext.projects.doctype.task.test_task.TestTask) ... ok
test_complete_task_without_assignment_closing (erpnext.projects.doctype.task.test_task.TestTask) ... ok
test_overdue (erpnext.projects.doctype.task.test_task.TestTask) ... ok
test_reschedule_dependent_task (erpnext.projects.doctype.task.test_task.TestTask) ... ok

----------------------------------------------------------------------
Ran 5 tests in 1.660s

@sahil28297 sahil28297 changed the title fix: fixed Task test case for project change fix: task test case for project change Oct 8, 2021
@sahil28297 sahil28297 merged commit c046765 into Bloomstack:develop Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants