Skip to content

Instantly share code, notes, and snippets.

@mihalt
Created October 17, 2022 15:13
Show Gist options
  • Save mihalt/c45aca5b694e021f97387849373fa626 to your computer and use it in GitHub Desktop.
Save mihalt/c45aca5b694e021f97387849373fa626 to your computer and use it in GitHub Desktop.
not_seen_currency_obj_by_django_fixtures
@pytest.fixture
def generate_keys(self, key_factory):
product_obj = Product.objects.get(pk=self.product_in_order_pk)
return lambda **kwargs: key_factory.create_batch(self.product_in_order_quantity, product=product_obj, **kwargs)
@pytest.fixture
def created_default_keys(self, generate_keys, internal_order):
return generate_keys(from_product_in_order__internal_order=internal_order,
from_product_in_order__internal_order__currency=Currency.objects.get(name="USD"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment