def METHOD_NAME(self, resource_group, location):
    lock_name = 'pylockrg'
    lock = self.locks_client.management_locks.create_or_update_at_resource_group_level(
        resource_group.name,
        lock_name,
        {
            'level': 'CanNotDelete'
        }
    )
    assert lock is not None
    self.locks_client.management_locks.get_at_resource_group_level(
        resource_group.name,
        lock_name
    )
    locks = list(self.locks_client.management_locks.list_at_resource_group_level(
        resource_group.name
    ))
    assert len(locks) == 1
    lock = self.locks_client.management_locks.delete_at_resource_group_level(
        resource_group.name,
        lock_name
    )