'If `Strict User Permissions` is checked in System Settings,
show records even if User Permissions are missing for a linked
doctype'

def test_strict_user_permissions(self):

    frappe.set_user(u'Administrator')
    frappe.db.sql(u'delete    from    tabContact')
    make_test_records_for_doctype(u'Contact', force=True)
    set_user_permission_doctypes(u'Contact', role=u'Sales    User', apply_user_permissions=1, user_permission_doctypes=[u'Salutation'])
    set_user_permission_doctypes(u'Salutation', role=u'All', apply_user_permissions=1, user_permission_doctypes=[u'Salutation'])
    add_user_permission(u'Salutation', u'Mr', u'test3@example.com')
    self.set_strict_user_permissions(0)
    frappe.set_user(u'test3@example.com')
    self.assertEquals(len(frappe.get_list(u'Contact')), 2)
    frappe.set_user(u'Administrator')
    self.set_strict_user_permissions(1)
    frappe.set_user(u'test3@example.com')
    self.assertTrue(len(frappe.get_list(u'Contact')), 1)
    frappe.set_user(u'Administrator')
    self.set_strict_user_permissions(0)
