-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
An article about better test fixtures
dependenciescan turnstoriesbusiness objects into pytest fixtures.- We will write better tests because our database fills up logic does not duplicate in
FactoryBoy. @valuedecorator can be used to return normal results from the factories.
@register
class SubmitCodeFixture(SubmitCode):
name = 'submit_code'
@value
def fixture(submit_code, user, token):
return submit_code(user, token)
user = require('request_code')
token = Faker('uuid')- profit: Tests coupled with business logic will fail if this logic changes. On the other side, we'll need to change each
FactoryBoyusage in our test suite to mirror actual behavior.
Reactions are currently unavailable