referenceError name changed to circularReferenceError

This commit is contained in:
Neil Trini Lasrado 2015-04-23 18:49:11 +05:30
parent 1fa8ed8a1f
commit c8f0c25088
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ from frappe import _
from frappe.model.document import Document
class ReferenceError(frappe.ValidationError): pass
class CircularReferenceError(frappe.ValidationError): pass
class Task(Document):
def get_feed(self):
@ -82,7 +82,7 @@ class Task(Document):
def check_recursion(self, task, task_list):
if task in task_list:
frappe.throw("Circular Reference Error", ReferenceError)
frappe.throw("Circular Reference Error", CircularReferenceError)
else :
task_list.append(task)
return frappe.db.get_value("Task", task, "depends_on")

View File

@ -7,7 +7,7 @@ from frappe.utils import getdate
test_records = frappe.get_test_records('Task')
from erpnext.projects.doctype.task.task import ReferenceError
from erpnext.projects.doctype.task.task import CircularReferenceError
class TestTask(unittest.TestCase):
def test_circular_refereence(self):
@ -37,7 +37,7 @@ class TestTask(unittest.TestCase):
task1.update({
"depends_on": task3.name
})
self.assertRaises(ReferenceError, task1.save)
self.assertRaises(CircularReferenceError, task1.save)
def test_reschedule_depending_task(self):
task1 = frappe.new_doc('Task')