Esempio n. 1
0
	def test_get_doc(self):
		server = FrappeClient(get_url(), "Administrator", "admin", verify=False)
		frappe.db.delete("Note", {"title": "get_this"})
		frappe.db.commit()

		server.insert_many([
			{"doctype": "Note", "public": True, "title": "get_this"},
		])
		doc = server.get_doc("Note", "get_this")
		self.assertTrue(doc)
Esempio n. 2
0
	def test_update_doc(self):
		server = FrappeClient(get_url(), "Administrator", "admin", verify=False)
		frappe.db.delete("Note", {"title": ("in", ("Sing", "sing"))})
		frappe.db.commit()

		server.insert({"doctype":"Note", "public": True, "title": "Sing"})
		doc = server.get_doc("Note", 'Sing')
		changed_title = "sing"
		doc["title"] = changed_title
		doc = server.update(doc)
		self.assertTrue(doc["title"] == changed_title)
Esempio n. 3
0
	def test_update_doc(self):
		server = FrappeClient(get_url(), "Administrator", "admin", verify=False)
		frappe.db.sql("delete from `tabNote` where title in ('Sing','sing')")
		frappe.db.commit()

		server.insert({"doctype":"Note", "public": True, "title": "Sing"})
		doc = server.get_doc("Note", 'Sing')
		changed_title = "sing"
		doc["title"] = changed_title
		doc = server.update(doc)
		self.assertTrue(doc["title"] == changed_title)
Esempio n. 4
0
    def test_get_doc(self):
        server = FrappeClient(frappe.get_site_config().host_name,
                              "Administrator",
                              "admin",
                              verify=False)
        frappe.db.sql('delete from `tabNote` where title = "get_this"')
        frappe.db.commit()

        server.insert_many([
            {
                "doctype": "Note",
                "public": True,
                "title": "get_this"
            },
        ])
        doc = server.get_doc("Note", "get_this")
        self.assertTrue(doc)