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
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
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
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
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
; 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
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
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.
>>>
>>>
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:
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.
>>
>>
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.
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
>>
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:
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
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:
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
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
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
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
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
20 matches
Mail list logo