[test] newsletter list

This commit is contained in:
Rushabh Mehta 2015-03-20 15:57:25 +05:30
parent acdd5189d1
commit 208a06f5f5
2 changed files with 2 additions and 6 deletions

View File

@ -48,8 +48,8 @@ class NewsletterList(Document):
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):

View File

@ -10,8 +10,6 @@ import unittest
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 @@ class TestNewletterList(unittest.TestCase):
added = new_list.import_from("Lead")
print added
self.assertEquals(added, n_leads)
frappe.delete_doc("Newsletter List", new_list.name)