[test] newsletter list
diff --git a/erpnext/crm/doctype/newsletter_list/newsletter_list.py b/erpnext/crm/doctype/newsletter_list/newsletter_list.py
index a1e0cc8..973955d 100644
--- a/erpnext/crm/doctype/newsletter_list/newsletter_list.py
+++ b/erpnext/crm/doctype/newsletter_list/newsletter_list.py
@@ -48,8 +48,8 @@
return self.total_subscribers
def on_trash(self):
- for d in frappe.get_all("Newsletter List Subscriber", {"newsletter_list": self.name}):
- frappe.delete_doc(d.doctype, d.name)
+ for d in frappe.get_all("Newsletter List Subscriber", "name", {"newsletter_list": self.name}):
+ frappe.delete_doc("Newsletter List Subscriber", d.name)
@frappe.whitelist()
def import_from(name, doctype):
diff --git a/erpnext/crm/doctype/newsletter_list/test_newsletter_list.py b/erpnext/crm/doctype/newsletter_list/test_newsletter_list.py
index d5d0d19..c715d85 100644
--- a/erpnext/crm/doctype/newsletter_list/test_newsletter_list.py
+++ b/erpnext/crm/doctype/newsletter_list/test_newsletter_list.py
@@ -10,8 +10,6 @@
class TestNewletterList(unittest.TestCase):
def test_import(self):
- frappe.delete_doc("Newsletter List", "_Test Newsletter List 1")
-
new_list = frappe.get_doc({
"doctype": "Newsletter List",
"title": "_Test Newsletter List 1"
@@ -21,8 +19,6 @@
added = new_list.import_from("Lead")
- print added
-
self.assertEquals(added, n_leads)
frappe.delete_doc("Newsletter List", new_list.name)