Thanks a lot.That really helped.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to
On 25/12/2015 7:09 PM, varun naganathan wrote:
Hi,
I basically want to know how i can run unittests on different
databases like Postgres and Mysql.The documnetation says something about
writing a custom settings file.However I'm unable to actually understand
how actually the settings file
Hi,
I basically want to know how i can run unittests on different databases
like Postgres and Mysql.The documnetation says something about writing a
custom settings file.However I'm unable to actually understand how actually
the settings file must look.
Could someone perhaps post a sample
Problem solved: nose.tools.set_trace :)
2011/7/8 Daniel França
> but my set_trace still freezes =/ If anyone have any idea what could be
> that.
>
> I'm on a Mac OS 10.6
>
>
> 2011/7/8 Daniel França
>
>> yeah, thanks a lot, it's not 'BR' but I passed the ID of country and state
>> and it worked
but my set_trace still freezes =/ If anyone have any idea what could be
that.
I'm on a Mac OS 10.6
2011/7/8 Daniel França
> yeah, thanks a lot, it's not 'BR' but I passed the ID of country and state
> and it worked. =)
>
>
> On Fri, Jul 8, 2011 at 12:15 AM, Shawn Milochik wrote:
>
>> Could it b
yeah, thanks a lot, it's not 'BR' but I passed the ID of country and state
and it worked. =)
On Fri, Jul 8, 2011 at 12:15 AM, Shawn Milochik wrote:
> Could it be because the test is passing 'Brasil' instead of 'BR'? I'm
> assuming 'BR' is a valid choice and 'Brasil' is invalid. That's why you're
Could it be because the test is passing 'Brasil' instead of 'BR'? I'm
assuming 'BR' is a valid choice and 'Brasil' is invalid. That's why
you're passing 'PR' instead of 'Paraná' in your data dictionary.
If the field isn't a required field, then your form.is_valid() would be
true, but there wou
Here's the verbosity result of tests running (using nose), the most
important part, I guess
Creating table cadastroav_country
==
ERROR: Tests Novo Usuario Cliente
--
I was thinking, if country isn't created, so this test should fail, but
that's not what happen when I was using nose
*country = Country.objects.get(pk=35)*
*self.assertEqual( country.name, 'Brasil' )*
*
*
On Thu, Jul 7, 2011 at 11:47 PM, Shawn Milochik wrote:
> On 07/07/2011 10:
On 07/07/2011 10:44 PM, Daniel França wrote:
I changed the test runner to default and the error message is a lot
more clear.
I got a DatabaseError: no such table: cadastroav_country
but this should be created by tests, right?
I'm using South, maybe it's a problem?
The problem could be with y
I changed the test runner to default and the error message is a lot more
clear.
I got a DatabaseError: no such table: cadastroav_country
but this should be created by tests, right?
I'm using South, maybe it's a problem?
2011/7/7 Daniel França
> I did some tests
> I put self.cleaned_data['X']
>
I did some tests
I put self.cleaned_data['X']
where X I change to all the fields of my form, it in *def clean() *function
and it seems only 2 fields aren't available, state and country, I believe
that it's not a coincidence that both of them are foreign key(objects).
I'm using a sqlite database an
You should be able to use pdb and then examine variables in scope.
Aren't you getting a pdb prompt? Are you redirecting your output?
You can also using logging and put a bunch of debug statements in to
narrow down where the problem lies.
If you can make a bare-bones copy of your app that dupl
I already tried to put the code in def clean(), same error,
and I did this change you suggested andré, but same error again.
as I said using the manual process the validation works fine
I don't know how to debug this in unit tests, pdb.set_trace simply freeze my
running tests =/
On Thu, Jul 7, 2
My guess is that the input for the country field in the test is not
the same as when a user POSTs the form.
This is probably because you're passing a Country instance rather than
country.name in your 'values' variable.
Furthermore, if country can be blank, you should use
if cleaned_data.get('cou
If you want to mess with 'country' then you write a clean_country(self)
function. If you want to mess with 'document' you write a
clean_document(self) function.
If you want to do something with one and be sure the other is also
available, you write a clean(self) function, which executes after
Hi,
I'm starting to use unit tests in Django, I got stuck in a client test I
can't figure out the solution,
As I don't have much experience in Django unit tests maybe the error is easy
to solve
I got this error message executing unit tests
apps/usuarios/forms.py", line 95, in clean_document
On Fri, Aug 27, 2010 at 1:43 AM, Elf_Sternberg wrote:
> Is anyone seeing this? I have this function at the top of my
> unittest:
>
> def create_user(name):
> username = name.replace(' ', '').lower()
> return User.objects.create_user(username, username + '@a.com',
> 'password')
>
> And then
On Thu, Aug 26, 2010 at 1:43 PM, Elf_Sternberg wrote:
> Is anyone seeing this? I have this function at the top of my
> unittest:
>
> def create_user(name):
>username = name.replace(' ', '').lower()
>return User.objects.create_user(username, username + '@a.com',
> 'password')
>
> And then
Is anyone seeing this? I have this function at the top of my
unittest:
def create_user(name):
username = name.replace(' ', '').lower()
return User.objects.create_user(username, username + '@a.com',
'password')
And then (this is ultimately the code I derived to examine this
behavior):
cl
Hi there,
I have a pretty weird problem: I have a model class MyUser derived
from djang.contrib.auth.models.User. It doesn't have any additional
fields, but a custom manager, with create_user method that puts the
created object in the group MyGroup after creating it.
When calling MyUser.objects.c
Benjamin Reitzammer wrote:
> Hi Thomas,
> how did you make sure, that the tests are read-only? Did you apply any
> special measures/tricks (like using a special DJANGO_SETTINGS_MODULE,
> that has read-ony access to the database), or are your tests read-only
> by convention and you trust the develop
?
Cheers
Benjamin
On Thu, Apr 15, 2010 at 10:10, Thomas Guettler wrote:
> Hi,
>
> I use django since several months and wrote a lot of
> readonly unittests that I run on live systems.
>
> I think Django has only a infrastructure for test
> which use a temporary database.
&
Hi,
I use django since several months and wrote a lot of
readonly unittests that I run on live systems.
I think Django has only a infrastructure for test
which use a temporary database.
I am happy with my solution, but it would be nice
to have the "infrastructure" in django itself.
Hello, I've run on the same problem and now I see that all my custom
templates overrides the default template.
I checked that if I rename my custom project/templates/registration
folder to something else the test runs ok, but if I rename the
template so it doesn't conflicts, it will work fine.
Wh
Hi,
i use django-1.1 with django.contrib.auth and django-registration.
When i run the unittests, i become an error. Anybody has an idea?
./manage.py test auth --settings=develsettings
/usr/lib/pymodules/python2.6/registration/models.py:4:
DeprecationWarning: the sha module is deprecated; use
On Mon, Sep 7, 2009 at 6:24 AM, Oleg Oltar wrote:
> Hi!
>
> I am trying to run unitests for one of my application.
>
> Here is the code of the test (it doesn't do anything yet)
>
> [snip]
> When I run those tests I get an error:
>
> Installing index for goserver.Game model
> .
> -
Hi!
I am trying to run unitests for one of my application.
Here is the code of the test (it doesn't do anything yet)
import os
import re
#import unittest
from django.core import management
from django.test import TestCase
from django.test.client import Client
from django.core import mail
from d
On Sat, Apr 18, 2009 at 12:31 AM, Russell Keith-Magee <
freakboy3...@gmail.com> wrote:
>
> On Sat, Apr 18, 2009 at 8:06 AM, Daniel Joshua Worth
> wrote:
> >> No - please don't. The Django docs explicitly state that Django's test
> >> framework is based on Python's unittest and doctest frameworks,
On Sat, Apr 18, 2009 at 8:06 AM, Daniel Joshua Worth
wrote:
>> No - please don't. The Django docs explicitly state that Django's test
>> framework is based on Python's unittest and doctest frameworks, and
>> provides links to the docs for those frameworks. It's not our place to
>> including "how
>
> No - please don't. The Django docs explicitly state that Django's test
> framework is based on Python's unittest and doctest frameworks, and
> provides links to the docs for those frameworks. It's not our place to
> including "how to use unittest" or "how to use doctest" documentation,
> as we
On Sat, Apr 18, 2009 at 5:32 AM, Alex Gaynor wrote:
>
> On Fri, Apr 17, 2009 at 5:28 PM, Daniel Joshua Worth
> wrote:
>>
>> Of course that worked. I would like to put a plug in for adding that the
>> tests need to begging with test in the docs. Would have saved me some
>> trouble. Thank you guys
On Fri, Apr 17, 2009 at 5:28 PM, Daniel Joshua Worth wrote:
> Of course that worked. I would like to put a plug in for adding that the
> tests need to begging with test in the docs. Would have saved me some
> trouble. Thank you guys so much for your help.
>
> Daniel Worth
>
>
> >
>
A cursory revi
Of course that worked. I would like to put a plug in for adding that the
tests need to begging with test in the docs. Would have saved me some
trouble. Thank you guys so much for your help.
Daniel Worth
--~--~-~--~~~---~--~~
You received this message because you ar
Well the docs use camel case for tests, so figured that was the
convention
in Django. But the there are also some other places where Django
doesn't
quite follow the rules, like using _ in some of the HTML it generates.
Maybe that part of the docs should be cleaned up, I always thought
camel
cases
On Fri, Apr 17, 2009 at 4:26 PM, google torp wrote:
>
> Hi.
> You have named your test incorectly, so django won't see it as a test.
> You need to name testCamelCaseName. Camel cases are probably not
> required but that's the convention. Try renaming your test.
>
> ~Jakob
>
> On Apr 17, 9:04 pm,
Hi.
You have named your test incorectly, so django won't see it as a test.
You need to name testCamelCaseName. Camel cases are probably not
required but that's the convention. Try renaming your test.
~Jakob
On Apr 17, 9:04 pm, Daniel Joshua Worth
wrote:
> If I run "./manage.py tests booking" it
If I run "./manage.py tests booking" it returns ok but says it ran 0 tests
so I'm obviously not doing something right if it's not running the test at
all. I keep reading the docs but it's not coming to me what I messed up.
--~--~-~--~~~---~--~~
You received this mes
>>> You should rather not name it "test.py" because there is a standard
>>>Python module with that name.
The file is named tests.py, plural(I miss typed). I am just trying to follow
the docs on unittests.
--~--~-~--~~~---~--~~
You receive
manage.py test . it returns OK.
> If I run manage.py test .. if Fails.
> What gives. Am I missing something as far as unittests are concerned? It
> should Fail every time or it's not much of a test.
Can you send your test.py file to the list?
You should rather not name it "test.py&quo
; If I run manage.py test . it returns OK.
> If I run manage.py test .. if Fails.
> What gives. Am I missing something as far as unittests are concerned? It
> should Fail every time or it's not much of a test.
Without specifics it isn't possible to know the exact problem.
Howev
s. Am I missing something as far as unittests are concerned? It
should Fail every time or it's not much of a test.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
Thank you, Karen. That has solved my problem completely. I
appreciate the complete explanation as well.
Kind regards,
Robert
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
On Thu, Feb 12, 2009 at 1:26 PM, Robert wrote:
>
> I'm am trying to build an application that handles several types of
> uploads. Currently, it will work fine for .txt type files, but for
> all other kinds of files, the file is truncated to about 3 KB.
>
> I have determined that the file gets tr
I'm am trying to build an application that handles several types of
uploads. Currently, it will work fine for .txt type files, but for
all other kinds of files, the file is truncated to about 3 KB.
I have determined that the file gets truncated during the request. I
have included some sample co
On Fri, Nov 7, 2008 at 8:17 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> GenericForeignKey and content type application itself look very doubtful for
> me. If you have a ForeignKey to the ContentType model then you depends on
> order with ContentType objects creates on syncdb. Because ContentTyp
GenericForeignKey and content type application itself look very doubtful for
me. If you have a ForeignKey to the ContentType model then you depends on
order with ContentType objects creates on syncdb. Because ContentType that
references to some model can have different primary key any time you flus
On Fri, Nov 7, 2008 at 1:00 AM, AndyH <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have the following simple test which demonstrates the confusing
> behaviour I'm seeing:
>
> class AvailabilityTestCase(django.test.TestCase):
>fixtures = FIXTURE_LIST
>def setUp(self):
>response = sel
Hello,
I have the following simple test which demonstrates the confusing
behaviour I'm seeing:
class AvailabilityTestCase(django.test.TestCase):
fixtures = FIXTURE_LIST
def setUp(self):
response = self.client.login(username='testuser',
password='password')
self.assertTrue
On Sun, 2008-09-28 at 21:25 +0200, Gerard Petersen wrote:
> Russel,
>
> Replies inline ...
>
> > The purpose of admin.autodiscover is to discover all the admin.py
> > files in your project. Each admin.py file will then need to contain
> > the ModelAdmin definitions and site.register() calls req
Russel,
Replies inline ...
> The purpose of admin.autodiscover is to discover all the admin.py
> files in your project. Each admin.py file will then need to contain
> the ModelAdmin definitions and site.register() calls required.
Ok, so the autodiscover is a recursive functionality that gathers
On Sun, Sep 28, 2008 at 4:39 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>
> Russell,
>
> Is it correct to say that the admin.autodiscover statement should register
> the models in 'myapp', and therefore I don't need the individual
> admin.site.register statement for each model?
No - that is
Russell,
Is it correct to say that the admin.autodiscover statement should register the
models in 'myapp', and therefore I don't need the individual
admin.site.register statement for each model?
Without the register statements I don't see the group of models (for myapp) and
myapp itself in th
On Sat, Sep 27, 2008 at 9:54 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>
> Russel,
>
> The example from the docs somehow doesn't work. I've turned on the
> autodiscover but under admin it stays empty. I don't know if this is related,
> but putting the register statements in urls.py does sto
Russel,
The example from the docs somehow doesn't work. I've turned on the autodiscover
but under admin it stays empty. I don't know if this is related, but putting
the register statements in urls.py does stop breaking my tests.
Regards,
Gerard.
Russell Keith-Magee wrote:
> On Sat, Sep 27, 2
On Sat, Sep 27, 2008 at 3:26 AM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> When I run my test suite, commands like these 'admin.site.register(Product,
> ProductAdmin)' in models.py break my tests with this error:
>
> django.contrib.admin.sites.AlreadyRegistered: The model Product
Hi all,
When I run my test suite, commands like these 'admin.site.register(Product,
ProductAdmin)' in models.py break my tests with this error:
django.contrib.admin.sites.AlreadyRegistered: The model Product is already
registered
When I (temporarily) remove them the tests run properly.
What
On 8/20/07, Viraj Alankar <[EMAIL PROTECTED]> wrote:
> My question is why does my test in polls need to know anything about
> the root url configuration of the project? This seems to couple my
> poll-specific unittest to the project and it would be cleaner to not
> need to specify the '/polls/' u
Hi,
I've just started playing around with Django and have a question on
unittesting. The docs mention that tests are looked for in the
models.py files of applications and a tests.py file in the application
directory. This seems to let me write tests specific to the
application. However, when usin
> The approach here will be to write your own test runner method. When
> you call 'manage.py test', Django is effectively calling a method
> called django.test.simple.run_tests(); this method sets up the test
> environment, finds the tests, runs the tests, and cleans up the test
> environment.
Th
On 6/26/07, Michal <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I try to write test together with coverage [1]. This tool could tell me,
> which lines of code was or wasn't executed and therefore tell, how my
> tests are (or aren't) "superior".
>
> I put initial code for coverage into setUp, and cleanu
Hello,
I try to write test together with coverage [1]. This tool could tell me,
which lines of code was or wasn't executed and therefore tell, how my
tests are (or aren't) "superior".
I put initial code for coverage into setUp, and cleanup to tearDown
method of Testcase class. Problem is, that
Waylan -
I removed the egg and voila! manage.py now knows about "test." Thanks
for your help.
- Bob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djan
On 12/14/06, Bob <[EMAIL PROTECTED]> wrote:
>
> Waylan -
> I have revision 4198, so that's okay, and my PYTHONPATH does not have
> anything about Django or site-packages in it at all. However, when I
> run python and print sys.path, I see:
>
> ['', 'c:\\Python24\\lib\\site-packages\\setuptools-0.
Waylan -
I have revision 4198, so that's okay, and my PYTHONPATH does not have
anything about Django or site-packages in it at all. However, when I
run python and print sys.path, I see:
['', 'c:\\Python24\\lib\\site-packages\\setuptools-0.6c1-py2.4.egg',
'c:\\Python24\\lib\\site-packages\\django
On 12/13/06, Bob <[EMAIL PROTECTED]> wrote:
>
> Don -
>
> How do I check the revision? import django; django.__version__ prints
> '0.95' but not the revision number.
On the command line from within your django_src directory do:
svn info
That should tell you the revision number among other
ot;.
Thanks,
Bob
On Dec 11, 1:23 pm, Don Arbow <[EMAIL PROTECTED]> wrote:
> On Dec 11, 2006, at 7:48 AM, Bob wrote:
>
>
>
> >http://www.djangoproject.com/documentation/testing/indicates that
> > unittests can be run with
> > ./manage.py test
>
> >
On Dec 11, 2006, at 7:48 AM, Bob wrote:
>
> http://www.djangoproject.com/documentation/testing/ indicates that
> unittests can be run with
> ./manage.py test
>
> However, when I run it, "test" is not known as an action. I get this
> output:
> ---
>
http://www.djangoproject.com/documentation/testing/ indicates that
unittests can be run with
./manage.py test
However, when I run it, "test" is not known as an action. I get this
output:
---
$ c:/Python24/Python manage.py test
Error: Your action, 'test', was inv
69 matches
Mail list logo