Skip to content

Commit

Permalink
fix: fix tests failing because of faker (#5163)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyorlando authored Oct 10, 2024
1 parent 04ab676 commit 93c0750
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engine/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@

# Faker that always returns unique values
class UniqueFaker(factory.Faker):
def __init__(self, provider, **kwargs):
if provider == "pyint":
# https://faker.readthedocs.io/en/master/providers/faker.providers.python.html#faker.providers.python.Provider.pyint
# https://raintank-corp.slack.com/archives/C06K1MQ07GS/p1728589562495709?thread_ts=1728586969.283779&cid=C06K1MQ07GS
kwargs["max_value"] = 9_999_999

super().__init__(provider, **kwargs)

@classmethod
def _get_faker(cls, locale=None):
return super()._get_faker(locale).unique
Expand Down

0 comments on commit 93c0750

Please sign in to comment.