Improved test_rename: check if comments are also moved on rename
This commit is contained in:
parent
8ac4643fd7
commit
0e72a87613
@ -41,11 +41,23 @@ class TestCustomer(unittest.TestCase):
|
|||||||
self.assertEquals(value, details.get(key))
|
self.assertEquals(value, details.get(key))
|
||||||
|
|
||||||
def test_rename(self):
|
def test_rename(self):
|
||||||
|
comment = frappe.new_doc("Comment")
|
||||||
|
comment.update({
|
||||||
|
"comment": "Test Comment for Rename",
|
||||||
|
"comment_doctype": "Customer",
|
||||||
|
"comment_docname": "_Test Customer 1"
|
||||||
|
})
|
||||||
|
comment.insert()
|
||||||
|
|
||||||
frappe.rename_doc("Customer", "_Test Customer 1", "_Test Customer 1 Renamed")
|
frappe.rename_doc("Customer", "_Test Customer 1", "_Test Customer 1 Renamed")
|
||||||
|
|
||||||
self.assertTrue(frappe.db.exists("Customer", "_Test Customer 1 Renamed"))
|
self.assertTrue(frappe.db.exists("Customer", "_Test Customer 1 Renamed"))
|
||||||
self.assertFalse(frappe.db.exists("Customer", "_Test Customer 1"))
|
self.assertFalse(frappe.db.exists("Customer", "_Test Customer 1"))
|
||||||
|
|
||||||
|
# test that comment gets renamed
|
||||||
|
self.assertEquals(frappe.db.get_value("Comment",
|
||||||
|
{"comment_doctype": "Customer", "comment_docname": "Test Customer 1 Renamed"}), comment.name)
|
||||||
|
|
||||||
frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user