[fix] test runner fixes

This commit is contained in:
Anand Doshi 2015-09-23 12:48:13 +05:30
parent 65ebc73a0a
commit 1dc5ebda32
2 changed files with 10 additions and 4 deletions

View file

@ -58,6 +58,8 @@ class Document(BaseDocument):
all values (including child documents) from the database.
"""
self.doctype = self.name = None
self._default_new_docs = {}
self.flags = frappe._dict()
if arg1 and isinstance(arg1, basestring):
if not arg2:
@ -83,9 +85,6 @@ class Document(BaseDocument):
# incorrect arguments. let's not proceed.
raise frappe.DataError("Document({0}, {1})".format(arg1, arg2))
self._default_new_docs = {}
self.flags = frappe._dict()
def reload(self):
"""Reload document from database"""
self.load_from_db()

View file

@ -231,9 +231,9 @@ def make_test_objects(doctype, test_records, verbose=None):
docstatus = d.docstatus
d.docstatus = 0
d.run_method("before_test_insert")
try:
d.run_method("before_test_insert")
d.insert()
if docstatus == 1:
@ -241,6 +241,13 @@ def make_test_objects(doctype, test_records, verbose=None):
except frappe.NameError:
pass
except Exception, e:
if d.flags.ignore_these_exceptions_in_test and e.__class__ in d.flags.ignore_these_exceptions_in_test:
pass
else:
raise
records.append(d.name)
frappe.db.commit()