def test_api_delete_notifications_by_admin():
    """Test that an admin can delete notifications"""
    app = create_ctfd()
    with app.app_context():
        gen_challenge(app.db)
        gen_notification(app.db)
        assert Notifications.query.count() == 1
        with login_as_user(app, name="admin") as client:
            r = client.delete("/api/v1/notifications/1", json="")
            assert r.status_code == 200
            assert r.get_json()["success"] is True
        assert Notifications.query.count() == 0
    destroy_ctfd(app)
Test that an admin can delete notifications
tests/api/v1/test_notifications.py