Title: Database fixtures considered harmful. · Issue #116 · dry-python/dry-python.github.io · GitHub
Open Graph Title: Database fixtures considered harmful. · Issue #116 · dry-python/dry-python.github.io
X Title: Database fixtures considered harmful. · Issue #116 · dry-python/dry-python.github.io
Description: An article about better test fixtures dependencies can turn stories business objects into pytest fixtures. We will write better tests because our database fills up logic does not duplicate in FactoryBoy. @value decorator can be used to r...
Open Graph Description: An article about better test fixtures dependencies can turn stories business objects into pytest fixtures. We will write better tests because our database fills up logic does not duplicate in Facto...
X Description: An article about better test fixtures dependencies can turn stories business objects into pytest fixtures. We will write better tests because our database fills up logic does not duplicate in Facto...
Opengraph URL: https://github.com/dry-python/dry-python.github.io/issues/116
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Database fixtures considered harmful.","articleBody":"#### An article about better test fixtures\r\n* `dependencies` can turn `stories` **business objects** into pytest fixtures.\r\n* We will write better tests because our database fills up logic **does not duplicate** in `FactoryBoy`.\r\n* `@value` decorator can be used to return normal results from the factories.\r\n```python\r\n@register\r\nclass SubmitCodeFixture(SubmitCode):\r\n\r\n name = 'submit_code'\r\n\r\n @value\r\n def fixture(submit_code, user, token):\r\n return submit_code(user, token)\r\n\r\n user = require('request_code')\r\n\r\n token = Faker('uuid')\r\n```\r\n* **profit**: Tests coupled with business logic will fail if this logic changes. On the other side, we'll need to change each `FactoryBoy` usage in our test suite to mirror actual behavior.","author":{"url":"https://github.com/proofit404","@type":"Person","name":"proofit404"},"datePublished":"2019-07-01T00:44:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/116/dry-python.github.io/issues/116"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7e83f4fe-f64b-8dc9-72c8-c00297e26388 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF94:2B46F2:29B21:39272:696A45E1 |
| html-safe-nonce | 76b3a9e290c0c2897bbd971c03a3360a249848244b5958357513cb08a744d75a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjk0OjJCNDZGMjoyOUIyMTozOTI3Mjo2OTZBNDVFMSIsInZpc2l0b3JfaWQiOiI4MTk1Mzc3NTA5MDIwODc4MzA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 992e0fa62d2266aeb5784308c027cec658717187a373ead845cfede0ffa63df6 |
| hovercard-subject-tag | issue:462466251 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/dry-python/dry-python.github.io/116/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6cd67bb7f43d0dcd140eac9daff1da14477ac0f44657660e98ab3aed2689fe8e/dry-python/dry-python.github.io/issues/116 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6cd67bb7f43d0dcd140eac9daff1da14477ac0f44657660e98ab3aed2689fe8e/dry-python/dry-python.github.io/issues/116 |
| og:image:alt | An article about better test fixtures dependencies can turn stories business objects into pytest fixtures. We will write better tests because our database fills up logic does not duplicate in Facto... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | proofit404 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| go-import | github.com/dry-python/dry-python.github.io git https://github.com/dry-python/dry-python.github.io.git |
| octolytics-dimension-user_id | 37993755 |
| octolytics-dimension-user_login | dry-python |
| octolytics-dimension-repository_id | 137952335 |
| octolytics-dimension-repository_nwo | dry-python/dry-python.github.io |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137952335 |
| octolytics-dimension-repository_network_root_nwo | dry-python/dry-python.github.io |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width