Skip to content

Commit

Permalink
test: add regression test for #965
Browse files Browse the repository at this point in the history
  • Loading branch information
skarzi authored and rbarrois committed Apr 25, 2024
1 parent 7ed1e54 commit 01c0a73
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,24 @@ class Params:

unknown_author = AuthorFactory(unknown=True)
self.assertEqual("", unknown_author.fullname)

def test_evaluated_without_locale(self):
"""Regression test for `KeyError: 'locale'` raised in `evaluate`.
See #965
"""
class AuthorFactory(factory.Factory):
fullname = factory.Faker("name")
pseudonym = factory.Maybe(
decider=factory.Faker("pybool"),
yes_declaration="yes",
no_declaration="no",
)

class Meta:
model = Author

author = AuthorFactory()

self.assertIn(author.pseudonym, ["yes", "no"])

0 comments on commit 01c0a73

Please sign in to comment.