from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
def test_v036_files():
    for p in ['app/api/v036.py','app/services/bi_report_v036.py','app/static/advanced-bi.html','migrations/036_advanced_bi_report_designer.sql']:
        assert (ROOT/p).exists()
def test_v036_visual_controls():
    text=(ROOT/'app/services/bi_report_v036.py').read_text()
    for x in ['VISUAL_TYPES','validate_widget','drill_config','conditional_formatting','create_share_link','render_report']:
        assert x in text
def test_v036_routes():
    text=(ROOT/'app/api/v036.py').read_text()
    for x in ['/themes','/dashboards','/widgets','/publish','/share','/report-templates','/render','/renders']:
        assert x in text
def test_v036_rls():
    text=(ROOT/'migrations/036_advanced_bi_report_designer.sql').read_text()
    assert 'ROW LEVEL SECURITY' in text and 'WITH CHECK' in text and 'app.current_tenant_id' in text
