Title: [Factory Boy] Create factory without model · Issue #20 · runtimerevolution/python-knowledge-base · GitHub
Open Graph Title: [Factory Boy] Create factory without model · Issue #20 · runtimerevolution/python-knowledge-base
X Title: [Factory Boy] Create factory without model · Issue #20 · runtimerevolution/python-knowledge-base
Description: Description Factory Boy requires a model to define a factory, however sometimes there's a need of taking advantage of the factory boy functionality without a model. Requirements Add an entry under Factory boy, where a solution such as th...
Open Graph Description: Description Factory Boy requires a model to define a factory, however sometimes there's a need of taking advantage of the factory boy functionality without a model. Requirements Add an entry under ...
X Description: Description Factory Boy requires a model to define a factory, however sometimes there's a need of taking advantage of the factory boy functionality without a model. Requirements Add an entry un...
Opengraph URL: https://github.com/runtimerevolution/python-knowledge-base/issues/20
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Factory Boy] Create factory without model","articleBody":"\r\n## Description\r\n\r\nFactory Boy requires a model to define a factory, however sometimes there's a need of taking advantage of the factory boy functionality without a model. \r\n\r\n## Requirements\r\n\r\nAdd an entry under Factory boy, where a solution such as the one below is presented.\r\n\r\n```python\r\nfrom typing import NamedTuple\r\nimport factory\r\n\r\n\r\nclass TestUser(NamedTuple):\r\n id: int\r\n name: str\r\n\r\n\r\nclass TestUserFactory(factory.Factory):\r\n class Meta:\r\n model = TestUser\r\n\r\n id = factory.Sequence(lambda n: 1000 + n)\r\n name = factory.Faker('name')\r\n```\r\n\r\n## Acceptance Criteria\r\n\r\nProvide a complete example\r\n\r\n```python\r\ntuf = TestUserFactory()\r\n```\r\n\r\nand \r\n\r\n```python\r\ntuf = TestUserFactory(name=\"John O'Reilly\")\r\n```","author":{"url":"https://github.com/kenvontucky","@type":"Person","name":"kenvontucky"},"datePublished":"2022-12-16T11:16:59Z","url":"https://github.com/runtimerevolution/python-knowledge-base/issues/20"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:a88d5c84-749c-73c8-8072-f4f002783f1c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BACE:AC6A2:29D8:366B:6B0159E6 |
| html-safe-nonce | f51e1794c8d77c03c98588f51c1886acaa2af724090f83578b185ae8f7381ff8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUNFOkFDNkEyOjI5RDg6MzY2Qjo2QjAxNTlFNiIsInZpc2l0b3JfaWQiOiIzNzg3NjI5OTA4MDY3NDQxMTI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 80d19d9e6ff1bd3a52090d30e322a6da22c0585127544895ec2b25e56b2b2b8c |
| hovercard-subject-tag | issue:1500033093 |
| 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/runtimerevolution/python-knowledge-base/20/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2fa375b999150bff9780768d0513979957275a911184c8481ca7690211b6a2f3/runtimerevolution/python-knowledge-base/issues/20 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2fa375b999150bff9780768d0513979957275a911184c8481ca7690211b6a2f3/runtimerevolution/python-knowledge-base/issues/20 |
| og:image:alt | Description Factory Boy requires a model to define a factory, however sometimes there's a need of taking advantage of the factory boy functionality without a model. Requirements Add an entry under ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kenvontucky |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/runtimerevolution/python-knowledge-base git https://github.com/runtimerevolution/python-knowledge-base.git |
| octolytics-dimension-user_id | 60465 |
| octolytics-dimension-user_login | runtimerevolution |
| octolytics-dimension-repository_id | 479346183 |
| octolytics-dimension-repository_nwo | runtimerevolution/python-knowledge-base |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 479346183 |
| octolytics-dimension-repository_network_root_nwo | runtimerevolution/python-knowledge-base |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width