[test] newsletter list
This commit is contained in:
parent
acdd5189d1
commit
208a06f5f5
@ -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):
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user