Skip to content

Commit

Permalink
Allow to specify locale on (test) user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Sep 29, 2021
1 parent 3765671 commit e3918ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions byceps/services/user/creation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def create_user(
email_address: Optional[str],
password: str,
*,
locale: Optional[str] = None,
legacy_id: Optional[str] = None,
first_names: Optional[str] = None,
last_name: Optional[str] = None,
Expand Down Expand Up @@ -75,6 +76,7 @@ def create_user(
created_at,
normalized_screen_name,
normalized_email_address,
locale=locale,
legacy_id=legacy_id,
)

Expand Down
2 changes: 2 additions & 0 deletions byceps/services/user/dbmodels/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ def __init__(
screen_name: Optional[str],
email_address: Optional[str],
*,
locale: Optional[str] = None,
legacy_id: Optional[str] = None,
) -> None:
self.created_at = created_at
self.screen_name = screen_name
self.email_address = email_address
self.locale = locale
self.legacy_id = legacy_id

@property
Expand Down
2 changes: 2 additions & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def create_user(
initialized: bool = True,
suspended: bool = False,
deleted: bool = False,
locale: Optional[str] = None,
legacy_id: Optional[str] = None,
first_names: Optional[str] = 'John Joseph',
last_name: Optional[str] = 'Doe',
Expand All @@ -123,6 +124,7 @@ def create_user(
screen_name,
email_address,
password,
locale=locale,
legacy_id=legacy_id,
first_names=first_names,
last_name=last_name,
Expand Down

0 comments on commit e3918ae

Please sign in to comment.