CoolFace
Apppublic

vishalbhat07/ctfd

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
test_model_utils.py24 linesDownload Raw Back to models
1from CTFd.models import (2    Challenges,3    Comments,4    Files,5    Solves,6    Submissions,7    get_class_by_tablename,8)9from tests.helpers import create_ctfd, destroy_ctfd10 11 12def test_get_class_by_tablename():13    """14    Test that get_class_by_tablename() returns the correct table15    """16    app = create_ctfd()17    with app.app_context():18        assert get_class_by_tablename("solves") == Solves19        assert get_class_by_tablename("comments") == Comments20        assert get_class_by_tablename("files") == Files21        assert get_class_by_tablename("submissions") == Submissions22        assert get_class_by_tablename("challenges") == Challenges23    destroy_ctfd(app)24