コード例 #1
0
    def test_block_list(self):
        self._clear_roles()

        from frappe.utils.user import add_role
        add_role("*****@*****.**", "HR User")
        clear_restrictions("Employee")

        frappe.db.set_value("Department", "_Test Department",
                            "leave_block_list", "_Test Leave Block List")

        application = self.get_application(_test_records[0])
        application.insert()
        application.status = "Approved"
        self.assertRaises(LeaveDayBlockedError, application.submit)

        frappe.set_user("*****@*****.**")

        # clear other applications
        frappe.db.sql("delete from `tabLeave Application`")

        application = self.get_application(_test_records[0])
        self.assertTrue(application.insert())
コード例 #2
0
	def test_block_list(self):
		self._clear_roles()

		from frappe.utils.user import add_role
		add_role("*****@*****.**", "HR User")
		clear_restrictions("Employee")

		frappe.db.set_value("Department", "_Test Department",
			"leave_block_list", "_Test Leave Block List")

		application = self.get_application(_test_records[0])
		application.insert()
		application.status = "Approved"
		self.assertRaises(LeaveDayBlockedError, application.submit)

		frappe.set_user("*****@*****.**")

		# clear other applications
		frappe.db.sql("delete from `tabLeave Application`")

		application = self.get_application(_test_records[0])
		self.assertTrue(application.insert())
コード例 #3
0
 def tearDown(self):
     frappe.set_user("Administrator")
     clear_restrictions("Blog Category")
     clear_restrictions("Blog Post")
コード例 #4
0
ファイル: test_blog_post.py プロジェクト: BitMistDev/frappe
	def tearDown(self):
		frappe.set_user("Administrator")
		clear_restrictions("Blog Category")
		clear_restrictions("Blog Post")