Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import instead of copy factories #31

Open
jonathan-s opened this issue Aug 26, 2019 · 3 comments
Open

Import instead of copy factories #31

jonathan-s opened this issue Aug 26, 2019 · 3 comments

Comments

@jonathan-s
Copy link
Contributor

@Aiky30 Perhaps we could import the factories we need from djangocms-versioning
instead copy and paste them?

@jonathan-s
Copy link
Contributor Author

@Aiky30 As a precedent, this is what djangocms-moderation does: https://github.com/divio/djangocms-moderation/blob/release/1.0.x/tests/utils/factories.py#L9-L12

@stuaxo
Copy link
Contributor

stuaxo commented Apr 20, 2020

Having the factories in test_utils, outside of the tests hierarchy is a good signal that they can be used elsewhere.

@Aiky30
Copy link
Member

Aiky30 commented Apr 20, 2020

@jonathan-s @stuaxo The main issue that was introduced in Versioning a long time ago was the dependence on the Versioning mocked apps, when I raised this with the author (Monika) she didn't want the factories reused and stated that you should create you're on in the apps. I would prefer to reuse them too but she made a good argument at the time.

Internal dependency:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants