Skip to content

Commit

Permalink
updates fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Dec 23, 2024
1 parent 2ab6fc6 commit fd17566
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: pip install ruff
- name: Check syntax
# Stop the build if there are Python syntax errors or undefined names
run: ruff check src/
run: ruff check --output-format concise src/

- name: Warnings
run: ruff format --check
13 changes: 11 additions & 2 deletions tests/contrib/hope/test_h_validators.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from typing import TYPE_CHECKING

import pytest
from faker import Faker

from country_workspace.contrib.hope.validators import FullHouseholdValidator

if TYPE_CHECKING:
from country_workspace.models import Household

fake = Faker()


@pytest.fixture
def program(household_checker, individual_checker):
Expand All @@ -21,10 +24,16 @@ def program(household_checker, individual_checker):


@pytest.fixture
def household(program) -> "Household":
def household(program, worker_id) -> "Household":
from testutils.factories import HouseholdFactory

return HouseholdFactory(batch__program=program, individuals=[], batch__country_office=program.country_office)
def name(instance: "Household", step: int) -> str:
name = fake.last_name()
return f"{name} @{worker_id} #{step}"

return HouseholdFactory(
name=name, batch__program=program, individuals=[], batch__country_office=program.country_office
)


def test_head(household: "Household"):
Expand Down

0 comments on commit fd17566

Please sign in to comment.