"""Unit tests for the release artist model.""" from artist.models import country, vendor from tests.testutils import db @db.test_schema def test_get_country_code_by_vendor_id(): """Test get_country_code_by_vendor_id method.""" country_code = 'JP' country_id = 1 new_country = country.Country(id=country_id, country_code=country_code) db.seed_models(new_country) new_vendor = vendor.Vendor(vendor_id=1, country=country_id) db.seed_models(new_vendor) response = vendor.get_country_code_by_vendor_id(new_vendor.vendor_id) assert response == country_code @db.test_schema def test_get_country_code_by_vendor_id_no_country(): """Test get_country_code_by_vendor_id method.""" new_vendor = vendor.Vendor(vendor_id=1) db.seed_models(new_vendor) response = vendor.get_country_code_by_vendor_id(new_vendor.vendor_id) assert response is None