def test_update_check_ignores_downgrades(fake_post_request):
    """Update checks do nothing on old or same versions"""
    app = create_ctfd()
    with app.app_context():
        app.config["UPDATE_CHECK"] = True
        fake_response = Mock()
        fake_post_request.return_value = fake_response
        fake_response.json = lambda: {
            "resource": {
                "html_url": "https://github.com/CTFd/CTFd/releases/tag/0.0.1",
                "download_url": "https://api.github.com/repos/CTFd/CTFd/zipball/0.0.1",
                "published_at": "Wed, 25 Oct 2017 19:39:42 -0000",
                "tag": "0.0.1",
                "prerelease": False,
                "id": 6,
                "latest": True,
            }
        }
        update_check()
        assert get_config("version_latest") is None

        fake_response = Mock()
        fake_post_request.return_value = fake_response
        fake_response.json = lambda: {
            "resource": {
                "html_url": "https://github.com/CTFd/CTFd/releases/tag/{}".format(
                    app.VERSION
                ),
                "download_url": "https://api.github.com/repos/CTFd/CTFd/zipball/{}".format(
                    app.VERSION
                ),
                "published_at": "Wed, 25 Oct 2017 19:39:42 -0000",
                "tag": "{}".format(app.VERSION),
                "prerelease": False,
                "id": 6,
                "latest": True,
            }
        }
        update_check()
        assert get_config("version_latest") is None
    destroy_ctfd(app)
Update checks do nothing on old or same versions
tests/utils/test_updates.py