mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 03:01:22 +00:00
feat: Minor changes to topic tests
This commit is contained in:
@@ -12,18 +12,20 @@ class TestTopic(unittest.TestCase):
|
|||||||
|
|
||||||
def test_get_contents(self):
|
def test_get_contents(self):
|
||||||
topic = frappe.get_doc("Topic", "_Test Topic 1")
|
topic = frappe.get_doc("Topic", "_Test Topic 1")
|
||||||
self.assertEqual(topic.name, "_Test Topic 1")
|
|
||||||
contents = topic.get_contents()
|
contents = topic.get_contents()
|
||||||
self.assertEqual(contents[0].doctype, "Article")
|
self.assertEqual(contents[0].doctype, "Article")
|
||||||
self.assertEqual(contents[0].name, "_Test Article 1")
|
self.assertEqual(contents[0].name, "_Test Article 1")
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
|
|
||||||
def make_topic(name):
|
def make_topic(name):
|
||||||
topic = frappe.get_doc({
|
try:
|
||||||
"doctype": "Topic",
|
topic = frappe.get_doc("Topic", name)
|
||||||
"topic_name": name,
|
except frappe.DoesNotExistError:
|
||||||
"topic_code": name,
|
topic = frappe.get_doc({
|
||||||
}).insert()
|
"doctype": "Topic",
|
||||||
|
"topic_name": name,
|
||||||
|
"topic_code": name,
|
||||||
|
}).insert()
|
||||||
return topic.name
|
return topic.name
|
||||||
|
|
||||||
def make_topic_and_linked_content(topic_name, content_dict_list):
|
def make_topic_and_linked_content(topic_name, content_dict_list):
|
||||||
|
|||||||
Reference in New Issue
Block a user