def test_update_check_identifies_update(fake_get_request):
    """Update checks properly identify new versions"""
    app = create_ctfd()
    with app.app_context():
        app.config["UPDATE_CHECK"] = True
        fake_response = Mock()
        fake_get_request.return_value = fake_response
        fake_response.json = lambda: {
            "resource": {
                "download_url": "https://api.github.com/repos/CTFd/CTFd/zipball/9.9.9",
                "html_url": "https://github.com/CTFd/CTFd/releases/tag/9.9.9",
                "id": 12,
                "latest": True,
                "next": 1542212248,
                "prerelease": False,
                "published_at": "Wed, 25 Oct 2017 19:39:42 -0000",
                "tag": "9.9.9",
            }
        }
        update_check()
        assert (
            get_config("version_latest")
            == "https://github.com/CTFd/CTFd/releases/tag/9.9.9"
        )
        assert get_config("next_update_check") == 1542212248
    destroy_ctfd(app)
Update checks properly identify new versions
tests/utils/test_updates.py