def validate_no_baltimore_city_comptroller():
    election_id = 'md-2004-11-02-general'
    office = Office.objects.get(state='MD', name='Comptroller')
    count = Contest.objects.filter(election_id=election_id, office=office).count() 
    msg = "There should be no comptroller contest for election {0}"
    assert count == 0, msg.format(election_id)
    count = Candidate.objects.filter(election_id=election_id,
        contest_slug='comptroller').count()
    msg = "There should be no comptroller candidates for election {0}"
    assert count == 0, msg.format(election_id)
    count = Result.objects.filter(election_id=election_id,
        contest_slug='comptroller').count()
    msg = "There should be no comptroller results for election {0}"
    assert count == 0, msg.format(election_id)
Should not have contest, candidates or results for a Baltimore City comptroller
dataset/ETHPy150Open openelections/openelections-core/openelex/us/md/validate/__init__.py/validate_no_baltimore_city_comptroller