Introducing factory-boy in django-oscar

113 views
Skip to first unread message

Andrea Grandi

unread,
Feb 6, 2014, 6:08:45 PM2/6/14
to django...@googlegroups.com
Hi everyone!

Today I was talking on #django-oscar IRC channel with maikhoepfel and linovia about the possibility to use factory-boy to generate data for unit tests.
If anyone of you doesn't know exactly what factory-boy is, you can give a look to a very short presentation I prepared few weeks ago: https://speakerdeck.com/andreagrandi/factoryboy-creating-data-for-unit-tests-in-an-easy-way

Before starting to work on it (well.. actually I already started, but in a personal branch, just to experiment...) and opening a issue ticket on GitHub, I wanted to announce/present it here, so if anyone has any objection, suggestion etc.... I can get it from now.

So, please, any comment, critic, suggestion is more than welcome :)

Cheers.

Sebastian Vetter

unread,
Feb 6, 2014, 6:15:52 PM2/6/14
to django...@googlegroups.com
Hi Andrea,

I think that's a great idea. I've used factory boy for test of Oscar extensions
 that I've worked on as well as some of our projects. I've actually started a
separate project on github with some generic factories. Feel free to grab
any of those that you can make use of. The repo is:

https://github.com/elbaschid/django-oscar-sweatshop

The factories there might not be the best for all cases as it still is a work in
progress but some might be a good starting point.

Cheers,
Seb

Maik Hoepfel

unread,
Feb 7, 2014, 4:26:25 AM2/7/14
to django...@googlegroups.com
Andi,

as discussed, I'm looking forward to this!

To give some background, django-dynamic-fixture is not Python 3
compatible and doesn't look like it will be anytime soon. That's why
we're looking at alternatives.

Cheers,

Maik
> --
> https://github.com/tangentlabs/django-oscar
> http://django-oscar.readthedocs.org/en/latest/
> https://twitter.com/django_oscar
> ---
> You received this message because you are subscribed to the Google
> Groups "django-oscar" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-oscar...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-oscar.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-oscar/0fed5d0f-ea2c-4d38-99e7-86ab073db8a5%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

a.gr...@gmail.com

unread,
Feb 7, 2014, 4:49:05 AM2/7/14
to django...@googlegroups.com
Hi Maik,

I'm very glad to have found a nice task to work on :)

I have already started working on my own branch and I can anticipate
you that there is a little libraries conflict when yoou try to "pip
install factory_boy", basically I had setuptools 0.6 installed in my
virtualenv. I upgraded both "pip" and "setuptools" and then I was able
to install "factory_boy" package without any problem. To verify that
everything was still working I ran the tests and they all passed.

p.s: I have started migrating a couple of tests to use the new factory
and.... they works :)
if you want to give it a preliminary look, my repository is here
https://github.com/andreagrandi/django-oscar/tree/factoryboy

Looking forward to send you the pull request :)

Cheers.
> --- You received this message because you are subscribed to a topic in the
> Google Groups "django-oscar" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-oscar/Owmi3J1rwlk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-oscar...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-oscar.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-oscar/52F4A6C1.1070702%40tangentsnowball.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



--
Andrea Grandi - Software Engineer / Qt Ambassador / Nokia Developer Champion
website: http://www.andreagrandi.it

Andrea Grandi

unread,
Feb 8, 2014, 4:00:02 AM2/8/14
to django...@googlegroups.com
First pull request is ready to be reviewed https://github.com/tangentlabs/django-oscar/pull/1192

Cheers.

Reply all
Reply to author
Forward
0 new messages