Splitting tests.py to package

2010-11-05 Thread Jari Pennanen
I've been trying to split tests.py, but I've noticed that models defined inside test module does not work. Normally one can define models in tests.py like this: class JSONFieldModel(models.Model): json = JSONField() class JSONFieldTest(TestCase): def setUp(self): pass def

Re: Splitting tests.py

2010-01-20 Thread Olivier Guilyardi
On 01/20/2010 01:21 PM, Matt Schinckel wrote: > On Jan 20, 9:25 pm, Olivier Guilyardi wrote: [...] >> Please see my last mail, this issue is resolved. Indeed it was import-related >> and silently failing. > > Yes, it came through as I was replying :) Then I think that it would

Re: Splitting tests.py

2010-01-20 Thread Matt Schinckel
On Jan 20, 9:25 pm, Olivier Guilyardi wrote: > On 01/20/2010 10:58 AM, Matt Schinckel wrote: > > > On Jan 19, 7:21 am, Olivier Guilyardi wrote: > >> On 01/18/2010 10:04 PM, Ramiro Morales wrote: > > >>> On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi

Re: Splitting tests.py

2010-01-20 Thread Olivier Guilyardi
On 01/20/2010 10:58 AM, Matt Schinckel wrote: > On Jan 19, 7:21 am, Olivier Guilyardi wrote: >> On 01/18/2010 10:04 PM, Ramiro Morales wrote: >> >> >>> On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: Hi, I'm trying to split tests.py into

Re: Splitting tests.py

2010-01-20 Thread Matt Schinckel
On Jan 19, 7:21 am, Olivier Guilyardi wrote: > On 01/18/2010 10:04 PM, Ramiro Morales wrote: > > > > > > > On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: > >> Hi, > > >> I'm trying to split tests.py into individual files into a tests/ > >> subfolder, but

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
; and it still has some small rough edges. > > I reverted back to r12254, same problem. Okay, I found the problem. In my tests I'm importing models, with something like: from models import ... That works when tests.py is located at the root of the app, that is: at the same level as the

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 10:04 PM, Ramiro Morales wrote: > On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: >> Hi, >> >> I'm trying to split tests.py into individual files into a tests/ subfolder, >> but >> that doesn't work. >> >> I correctly import everything from within

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 09:58 PM, Shawn Milochik wrote: > On Jan 18, 2010, at 3:50 PM, Olivier Guilyardi wrote: > >> On 01/18/2010 08:59 PM, Shawn Milochik wrote: >>> Here's a fantastic resource. It's what I used to switch to this >>> methodology. It talks you through exactly how to do this. >>> >>>

Re: Splitting tests.py

2010-01-18 Thread Ramiro Morales
On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: > Hi, > > I'm trying to split tests.py into individual files into a tests/ subfolder, > but > that doesn't work. > > I correctly import everything from within tests/__init__.py, as previously > said > on this mailing list:

Re: Splitting tests.py

2010-01-18 Thread Shawn Milochik
On Jan 18, 2010, at 3:50 PM, Olivier Guilyardi wrote: > On 01/18/2010 08:59 PM, Shawn Milochik wrote: >> Here's a fantastic resource. It's what I used to switch to this methodology. >> It talks you through exactly how to do this. >> >>

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 08:59 PM, Shawn Milochik wrote: > Here's a fantastic resource. It's what I used to switch to this methodology. > It talks you through exactly how to do this. > > http://ericholscher.com/blog/2008/nov/4/introduction-pythondjango-testing-basic-unit-tests/ Oh yes, I found this one.

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 09:19 PM, Reinout van Rees wrote: > On 01/18/2010 08:40 PM, Olivier Guilyardi wrote: >> Hi, >> >> I'm trying to split tests.py into individual files into a tests/ >> subfolder, but >> that doesn't work. >> >> I correctly import everything from within tests/__init__.py, as >>

Re: Splitting tests.py

2010-01-18 Thread Reinout van Rees
On 01/18/2010 08:40 PM, Olivier Guilyardi wrote: Hi, I'm trying to split tests.py into individual files into a tests/ subfolder, but that doesn't work. I correctly import everything from within tests/__init__.py, as previously said on this mailing list:

Re: Splitting tests.py

2010-01-18 Thread Shawn Milochik
Here's a fantastic resource. It's what I used to switch to this methodology. It talks you through exactly how to do this. http://ericholscher.com/blog/2008/nov/4/introduction-pythondjango-testing-basic-unit-tests/ Shawn-- You received this message because you are subscribed to the Google

Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
Hi, I'm trying to split tests.py into individual files into a tests/ subfolder, but that doesn't work. I correctly import everything from within tests/__init__.py, as previously said on this mailing list:

Re: splitting tests.py

2009-01-23 Thread gderazon
Thanks! it works! On Jan 23, 5:42 pm, Raffaele Salmaso wrote: > gderazon wrote: > >> tests/ > >> +- __init__.py > >> +- test1.py > >> +- test2.py > >> \- test3.py > > if you are using unittest in __init__.py: > > from test1.py import * > from test2.py import * > from

Re: splitting tests.py

2009-01-23 Thread Raffaele Salmaso
gderazon wrote: >> tests/ >> +- __init__.py >> +- test1.py >> +- test2.py >> \- test3.py if you are using unittest in __init__.py: from test1.py import * from test2.py import * from test3.py import * if you are using doctest in __init__.py: from test1 import MY_TEST1 from test2 import

Re: splitting tests.py

2009-01-23 Thread gderazon
Thanks Raffaele, I tried it, and it seems to ignore the tests files. (I get "Ran 0 tests in 0.000s") Is there anything that I should write in the __init__.py file? On Jan 23, 4:27 pm, Raffaele Salmaso wrote: > gderazon wrote: > > My tests.py has become too big, I

Re: splitting tests.py

2009-01-23 Thread Raffaele Salmaso
gderazon wrote: > My tests.py has become too big, I want to split it to several test > files and still be able to run the tests with manage.py tests ... > How can I do that? > I'm working with django 1.0 stable release. tests/ +- __init__.py +- test1.py +- test2.py \- test3.py -- ()_() | That

splitting tests.py

2009-01-23 Thread gderazon
My tests.py has become too big, I want to split it to several test files and still be able to run the tests with manage.py tests ... How can I do that? I'm working with django 1.0 stable release. --~--~-~--~~~---~--~~ You received this message because you are