def assert_popup_refresh(response):
    """assert the colorbox response redirects to the right page"""
    if response.status_code != 200:
        raise Exception(
            "colobox Response didn't redirect as expected: Response code was {0} (expected 200)"
            .format(response.status_code))
    expected_content = (
        b'<script>$.colorbox.close(); window.location=window.location;</script>'
        )
    if response.content != expected_content:
        raise Exception("Don't refresh page")
