feat: Minor changes to topic tests

This commit is contained in:
scmmishra
2019-03-06 15:19:02 +05:30
parent 2cec025bbe
commit 4a7e2c1e2f

View File

@@ -12,13 +12,15 @@ 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):
try:
topic = frappe.get_doc("Topic", name)
except frappe.DoesNotExistError:
topic = frappe.get_doc({ topic = frappe.get_doc({
"doctype": "Topic", "doctype": "Topic",
"topic_name": name, "topic_name": name,