'Asserts whether or not the user has permission to access an object.
Arguments
user (User)
permitted (boolean)'

def assert_user_has_object_permission(self, user, permitted):

    self.request.user = user
    self.assertEqual(self.permission.has_object_permission(self.request, None, self.obj), permitted)
