You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to replicate the issue have above. Looking at how the code generates the values using a random generator method which is referencing the same country data. How ever I would question if using a random generator twice with the same seed would be the right approach. As once you have a known expected value (your generated country), it would make sense to reference the country code from the same country data it has been randomised from. Below is a snippet of code which does this.
from faker.proxy import Faker as f
from faker.providers.date_time import Provider
from faker.generator import Generator
from faker.providers import BaseProvider
g = Generator()
b = BaseProvider(g)
p = Provider(b)
f.seed(0)
c = f().country()
cc = [Country for Country in p.countries if Country.name == c]
for each in cc:
country_code = each.alpha_2_code
When pulling things like
country()
, it would be useful if thecountry_code()
matched, but it currently doesn't.Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: