Skip to content

Instantly share code, notes, and snippets.

@JayH5
Last active November 23, 2017 13:31
Show Gist options
  • Save JayH5/cd94c3119c58d72be528a6b4a3858fb1 to your computer and use it in GitHub Desktop.
Save JayH5/cd94c3119c58d72be528a6b4a3858fb1 to your computer and use it in GitHub Desktop.
Django container pytest fixture
# Create definition instances
socket_volume = VolumeDefinition("socket")
static_volume = VolumeDefinition("static")
django_container = DjangoContainer("django", socket_volume, static_volume,
postgresql_container.database_url())
# Create pytest fixtures
socket_volume_fixture = socket_volume.pytest_fixture("socket_volume")
static_volume_fixture = static_volume.pytest_fixture("static_volume")
django_fixture = django_container.pytest_fixture(
"django_container",
dependencies=["socket_volume", "static_volume", "postgresql_container"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment