Anyone testing async views with django test client?

2022-09-20 Thread 'SP' via Django users
My async CBV works when accessed through my url endpoint with REQUESTS package. But with the django test client it seems to think the database doesn't contain the information I'm trying to pull using ORM. I've confirmed that the data DOES exist in the newly recreated DB (

Debug Django Test-cases

2022-02-25 Thread HEMENDRA SINGH HADA
Hi Team, I am writing some django test-cases, there are multiple test-cases are failing inside view or models, but I am not getting exact root cause for those failure, Could you please suggest me any tool which is used to debug the django unit test cases, Also if you can share my some good

Unable to add token headers to graphene-django test using pytest

2021-10-04 Thread Muhammad Shehzad
*I am trying to add a token to graphene-django headers using pytest. But It always return that user is anonymous as shown at the end but it should return user as token is added in fixture@pytest.fixture def client_query(client): def func(*args, **kwargs): return graphql_query(*args, **kwargs, clien

Django test runner not respecting unittest.TestCase?

2020-08-10 Thread Derek DeHart
For one of my functional tests, I decided to use unittest.TestCase instead of a Django test class because it was convenient when cleaning up the test to have direct access to my local development database in the test itself. Running the test in isolation like so passes as I'd expect: $ p

Django test

2019-04-22 Thread Elber Tavares
Test django -- 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 django-users@googlegr

Re: Inconsistent Django test results depending upon how the test is called in Django 1.5.1 running on Python 2.7.4

2019-03-27 Thread Ruben Alves
gunda-feira, 2 de dezembro de 2013 00:24:01 UTC, Paul Whipp escreveu: > > I have test cases that pass when tested individually, pass when the full > app is tested but fail when the tests for the entire project are run: > > (lsapi)~ $ django test > Creating test data

Django test command fail after changing models.py to a directory structure

2019-01-10 Thread Gonzalo Amadio
This is in Django 2.0 , python 3.6.5 I have an app called posts, and I changed models.py to a folder structure, i.e., create a directory models and move the file models.py insid. Also config __ init__.py file, as explained next. The project runs ok, but my test suite fails. In my settings, i

Re: Cannot get Django test migrations to detect test models.py

2018-11-05 Thread chris
fail when they are run because the tables are missing. From: "Phako Perez" <13.phak...@gmail.com> To: "django-users" Sent: Saturday, November 3, 2018 7:06:19 PM Subject: Re: Cannot get Django test migrations to detect test models.py I can suggest to use different

Re: Cannot get Django test migrations to detect test models.py

2018-11-05 Thread chris
I'm not sure you understood the question. From: "amit pant" To: "django-users" Sent: Monday, November 5, 2018 2:24:51 AM Subject: Re: Cannot get Django test migrations to detect test models.py can you register your model in admin.py? If not then go for it. On

Re: Cannot get Django test migrations to detect test models.py

2018-11-05 Thread amit pant
can you register your model in admin.py? If not then go for it. On Sun 4 Nov, 2018, 12:10 AM , wrote: > Hi folks, I'm trying to build a test suite for a django plugin for a > field. To test the field I need to have a test model, but since my django > app does not provide models, and I have the m

Re: Cannot get Django test migrations to detect test models.py

2018-11-03 Thread Phako Perez
I can suggest to use different name for your test app, as directory test is used by Django for actual test your application, maybe is that the reason your app is failing Sent from my iPhone > On Nov 3, 2018, at 12:40 PM, ch...@routh.io wrote: > > Hi folks, I'm trying to build a test suite for

Cannot get Django test migrations to detect test models.py

2018-11-03 Thread chris
Hi folks, I'm trying to build a test suite for a django plugin for a field. To test the field I need to have a test model, but since my django app does not provide models, and I have the model in the /tests/models.py it's not detecting the model when the test db migrations are applied. I saw som

Re: Django test command with --parallel

2018-01-10 Thread Yevhen Yevhen
ns) >> File >> "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/core/management/base.py", >> >> line 330, in execute >> output = self.handle(*args, **options) >> File >> "/Users/me/.virtualenvs/project/lib/python

Re: Django test command with --parallel

2018-01-10 Thread Avraham Serour
ement/base.py", line 330, in execute > output = self.handle(*args, **options) > File "/Users/me/.virtualenvs/project/lib/python3.6/site- > packages/django/core/management/commands/test.py", line 62, in handle > failures = test_runner.run_tests(test_labels) >

Re: Django test command with --parallel

2018-01-10 Thread Yevhen Yevhen
e failures = test_runner.run_tests(test_labels) File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django/test/runner.py", line 603, in run_tests result = self.run_suite(suite) File "/Users/me/.virtualenvs/project/lib/python3.6/site-packages/django

Django test command with --parallel

2018-01-09 Thread Yevhen Yevhen
I try to run my django tests using --parallel flag but get the following error (pastebin) . How can I fix this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving ema

Re: Bug to set session in Django Test?

2017-09-30 Thread Tim Graham
:30:25 AM UTC-4, ThePhi wrote: > > Hi! > > I have troubles setting cookie in Django test. > > class Test_views(TestCase): > def test_set_cookie(self): > session = self.client.session > session['mycookie'] = 'testcookie' >

Re: How do you interact with the Django test database outside of tests?

2017-08-30 Thread Kurt Wheeler
I've figured it out! I was running my end-to-end tests in a class which inherited from TestCase. This cause all the database calls for that entire class to be run within a transaction, so I couldn't see the changes because the transaction was never allowed to finish. By switching the base class

How do you interact with the Django test database outside of tests?

2017-08-25 Thread Kurt Wheeler
I am attempting to write end-to-end tests for my system. To do this I am running one container called "workers" as it would normally be run during development, i.e. not via a test runner. I have another container called "foreman" that is run via a test runner which sets up the tests, sends work

Re: Need to connect to django test database from out side of django(celery worker)

2017-07-01 Thread sarvi
nt to the test database > > Be sure the worker and the django test runner are pointed to the same > database, the django test runner creates and drops a database for the tests > > https://docs.djangoproject.com/en/1.11/topics/testing/overview/#the-test-database > > > On M

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-27 Thread Avraham Serour
py instead of settings.py You should create a special settings file to use for tests which will point to the test database Be sure the worker and the django test runner are pointed to the same database, the django test runner creates and drops a database for the tests https://docs.djangoproject.com/e

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-26 Thread Jani Tiainen
ould be a celery worker >> >> Would that work for you? >> >> On Mon, Jun 26, 2017 at 6:19 PM, sarvi wrote: >> >>> anybody have any suggestions on how I can do this? >>> >>> >>> I essentially want a worker process to connect to t

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-26 Thread sarvi
y suggestions on how I can do this? >> >> >> I essentially want a worker process to connect to the django test >> database ? >> >> >> On Thursday, June 22, 2017 at 11:56:41 AM UTC-7, sarvi wrote: >>> >>> I do have and use eager = True f

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-26 Thread Avraham Serour
gestions on how I can do this? > > > I essentially want a worker process to connect to the django test > database ? > > > On Thursday, June 22, 2017 at 11:56:41 AM UTC-7, sarvi wrote: >> >> I do have and use eager = True for local developer testing, environment. &g

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-26 Thread sarvi
anybody have any suggestions on how I can do this? I essentially want a worker process to connect to the django test database ? On Thursday, June 22, 2017 at 11:56:41 AM UTC-7, sarvi wrote: > > I do have and use eager = True for local developer testing, environment. > And I have bee

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-22 Thread sarvi
make sure there are no problems when running them in a real world distributed model a Implements well. So What I am trying to do is to create my own custom Django Test Runner that 1. Lets the regular django test runner create/setup the test database 2. Start the Celery worker and have it

Re: Need to connect to django test database from out side of django(celery worker)

2017-06-22 Thread Avraham Serour
Any special reason you are not using eager=true for celery under test? On Jun 22, 2017 7:17 PM, "sarvi" wrote: > > Can someone help me with how can I get my celery worker process(standalone > app outside of djanog) to talk to a django test database ? > > I am trying to

Need to connect to django test database from out side of django(celery worker)

2017-06-22 Thread sarvi
Can someone help me with how can I get my celery worker process(standalone app outside of djanog) to talk to a django test database ? I am trying to test a celery/django app. I plan on starting the celery worker process with a custom TestRunner. So that the worker process starts after the

Errors In Django Test

2016-07-06 Thread Rishabh Jain
I have written tests for my Users model., but when i run "python manage.py test " it throws me a error. please help. I am also uploading the error file for review. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group a

Re: the Django test client - https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client

2016-07-02 Thread ludovic coues
following the official tutorial...number 5 about testing... * > > *https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client > <https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client>* > > > *What am I doing wrong here?

the Django test client - https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client

2016-07-02 Thread Ricardo Valério
*I'm following the official tutorial...number 5 about testing... * *https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client <https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client>* *What am I doing wrong here? * *Thanks for the help

Django Test Errors

2016-05-21 Thread Yoseph Radding
I apologize as I inadvertently submitted my last post and cant delete it. Any way: I am in the midst of writing unit tests for an application I am working on. My tests work fine on my 2012 Macbook pro but not my 2015 iMac. Both are running the latest OSX and the django version is version 1.9.1

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread John Griebel
Glad to hear it, sorry I wasn't more help. On Fri, Apr 15, 2016 at 10:49 AM, wrote: > Hey John, > cool it runs now. > I had multiple problems: > > 1.) I granted ALL rights to my user on the test DB. > ==> This solved the issue with the TransactionManagementError. > > 2.) I had to do some changes

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread schaf . mh
Hey John, cool it runs now. I had multiple problems: 1.) I granted ALL rights to my user on the test DB. ==> This solved the issue with the TransactionManagementError. 2.) I had to do some changes in my configuration and play around. Afterwards the tests were running. But not all green :-| Tha

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread schaf . mh
No I have not added a target. The reason is that there is a class deriving from NoseTestSuiteRunner. This class defines the run_tests function which modifies the test_labels passed to the base 'constructor'. If I add a Target for a single test (testclass.testMethod) then just this test method wo

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread John Griebel
The next step (for me at least) would be to start removing/commenting out things from the tests file until you stop getting the error. Hopefully that will tell you what statement(s) may be causing the problem. Although I fear you may be correct in thinking this is a configuration issue. Have you t

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread schaf . mh
Hi John, I did now comment out those two files, but still get the same error. Maybe I have a wrong configuration or so. I'm quite new in Django / Python. Regards schaf Am Freitag, 15. April 2016 15:11:40 UTC+2 schrieb John Griebel: > > That's what I would try. > > On Fri, Apr 15, 2016 at 9:02 AM

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread John Griebel
That's what I would try. On Fri, Apr 15, 2016 at 9:02 AM, wrote: > Hi John, > thanks, but I did already check for @transaction.commit_manually in the > code, but PyCHarm serahc just finds this in the > virtualenv/python2.7/site-packages/django_extensions/management/commands. > So in my code ther

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread schaf . mh
Hi John, thanks, but I did already check for @transaction.commit_manually in the code, but PyCHarm serahc just finds this in the virtualenv/python2.7/site-packages/django_extensions/management/commands. So in my code there is nothing, would you recommend to comment those out, even if it is not

Re: Running Django-Test fails with TransactionManagementError

2016-04-15 Thread John Griebel
If you have methods using the @transaction.commit_manually decorator, comment those out temporarily. You should get a more helpful error message after doing so. On Fri, Apr 15, 2016 at 4:44 AM, wrote: > Hi All, > I took over some projects written with Python 2.7 / Django 1.5.1. > For unit tests

Running Django-Test fails with TransactionManagementError

2016-04-15 Thread schaf . mh
Hi All, I took over some projects written with Python 2.7 / Django 1.5.1. For unit tests the django-nose 1.2 (nose 1.3.3) is used and the project structure has its own tests directory which contains the testrunner.py. As a development environment I use PyCharm. As I wanted to run the unit tests I

Re: How should it make django test create a default_test database that is using 5 shemas ?

2016-02-04 Thread JAMES DAMILD ETIENNE
Ok thanks , make sense , 'ill try to do that thank you > > > > > -- 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

Re: How should it make django test create a default_test database that is using 5 shemas ?

2016-02-04 Thread Michal Petrucha
On Fri, Jan 29, 2016 at 02:50:07PM -0800, JAMES DAMILD ETIENNE wrote: > I have a possgres database with 5 shemas , it connects very well to it , > but when truing to do unit test on my models or view , the default table > created in sqllite3 is saysing that on of my table is not there : > > re

Re: How should it make django test create a default_test database that is using 5 shemas ?

2016-02-04 Thread JAMES DAMILD ETIENNE
> > any help please ? > thank you > On Friday, January 29, 2016 at 6:31:17 PM UTC-5, JAMES DAMILD ETIENNE wrote: > > I have a possgres database with 5 shemas , it connects very well to it , > but when truing to do unit test on my models or view , the default table > created in sqllite3 is say

how to run django test with a default test database , while the real database is a posgres with 5 shemas ?

2016-01-29 Thread JAMES DAMILD ETIENNE
any help please ? -- 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 django-users@g

How should it make django test create a default_test database that is using 5 shemas ?

2016-01-29 Thread JAMES DAMILD ETIENNE
I have a possgres database with 5 shemas , it connects very well to it , but when truing to do unit test on my models or view , the default table created in sqllite3 is saysing that on of my table is not there : return Database.Cursor.execute(self, query, params) OperationalError: no such tabl

Re: Django Test Coverage

2015-05-28 Thread Gergely Polonkai
Hello, IMHO it is much better to see the coverage values for everything (even tests.py). Your actual case, for example, shows that only 98 lines are running from your 100 lines long tests.py. This may mean that there is a condition somewhere in your test cases that never evaluates to true. If you

Django Test Coverage

2015-05-28 Thread Dharmit Shah
Hello all, I have a django app which is full REST APIs created using Django Rest Framework. In tests.py, I am testing fthe APIs using self.client.post and self.clilent.get. I use coverage tool to figure out the test coverage but it seems to check the coverage in a way I don't really understand.

Re: Accessing Django test client in setUpClass

2015-01-29 Thread Fred Stluka
icole Harris wrote: I just posted this on Stack Overflow and then realised I might have more luck here. Basically, I'd like to know if I can access self.client inside setUpClass(cls) when setting up a Django test: http://stackoverflow.com/questions/28084683/accessing-django-test-client-in-setu

Re: Accessing Django test client in setUpClass

2015-01-22 Thread Russell Keith-Magee
more > luck here. > > Basically, I'd like to know if I can access self.client inside > setUpClass(cls) when setting up a Django test: > > http://stackoverflow.com/questions/28084683/accessing-django-test-client-in-setupclass > > If anybody has any insight on this, I&#x

Accessing Django test client in setUpClass

2015-01-22 Thread Nicole Harris
I just posted this on Stack Overflow and then realised I might have more luck here. Basically, I'd like to know if I can access self.client inside setUpClass(cls) when setting up a Django test: http://stackoverflow.com/questions/28084683/accessing-django-test-client-in-setupclass If an

Running Django Test Suite with pytest

2015-01-14 Thread Jozef knaperek
Hello, I'd like to know if anybody has tried to run Django's own tests via pytest. Django does have its own, quite extensive runtests.py script which is intended for testing Django codebase. I need to execute the test suite with py.test though (in order to make use of some pytest plugin). Any sug

Re: Django test discovery and RuntimeError: Conflicting 'entry_tags' models in application 'entries': and .

2014-11-02 Thread Collin Anderson
Hello, The problem is that both D:\projekty\ogloszenia and D:\projekty\ogloszenia\src\apps are on your python path. The recommended way to do it is to import all of your code relative to manage.py and only have that directory on your python path, so in your case, that would be: src.apps.entrie

Re: Django test discovery and RuntimeError: Conflicting 'entry_tags' models in application 'entries': and .

2014-11-01 Thread Petey
I did a simple workaround for this. http://stackoverflow.com/a/26691861/926961 but in my opinion it should get fixed somehow without workarounds :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Django test discovery and RuntimeError: Conflicting 'entry_tags' models in application 'entries': and .

2014-11-01 Thread Petey
Hello! I've written on that topic here: http://stackoverflow.com/questions/26688775/django-cant-discover-tests-correctly What I discovered is: - unittest.loader ignores directories which are provided manually in settings to sys.path - unittest.loader requires __init__.py in a directory to look t

Re: Improving django test startup performance.

2014-03-05 Thread Andrew Farrell
is almost certainly something in the test discovery process. I suppose this means that digging up and mapping out the piping that runs through nose <https://github.com/nose-devs/nose>, django-nose<https://github.com/django-nose/django-nose>, the django test-discovery code

Re: Improving django test startup performance.

2014-03-05 Thread Tom Evans
On Wed, Mar 5, 2014 at 8:52 PM, Andrew Farrell wrote: > Привет Djanonaughts! > > tl;dr: django with buildout spends a lot of time looking for files that > aren't there when trying to do imports. How can I reduce this? (I did read :) The first thing that springs to mind is test discovery. I may b

Re: Improving django test startup performance.

2014-03-05 Thread Russell Keith-Magee
bout another component of test performance: Disk I/O > syscalls > > My company (the startup accelerator MassChallenge) uses > buildout<http://www.buildout.org/en/latest/> to > manage dependencies and the several apps modules within our appication. So > I run tests from the root

Improving django test startup performance.

2014-03-05 Thread Andrew Farrell
out.org/en/latest/> to manage dependencies and the several apps modules within our appication. So I run tests from the root of the buildout by calling `bin/django test`, a script that looks like the following: (note the datetime printing) ``` #!/home/afarrell/projects/masschallenge/venv/bin/pyth

Re: Django test client encoding of JSON Booleans

2014-02-24 Thread Tom Evans
On Mon, Feb 24, 2014 at 7:37 PM, Daniel Smith wrote: > Thank you very much for the help. So it sounds like I just have to suck it > up and call json.loads() on request.body. > > The 'format=json' thing is related to also using the TastyPie test client. > I've tried both and forgot where that param

Re: Django test client encoding of JSON Booleans

2014-02-24 Thread Daniel Smith
Thank you very much for the help. So it sounds like I just have to suck it up and call json.loads() on request.body. The 'format=json' thing is related to also using the TastyPie test client. I've tried both and forgot where that parameter was used. Thanks, Daniel On Saturday, February 22, 20

Re: Django test client encoding of JSON Booleans

2014-02-22 Thread Camilo Torres
On Friday, February 21, 2014 6:14:14 PM UTC-4:30, Daniel Smith wrote: > > I'm using Django version 1.5.5. Here is a short snippet of the test I'm > writing: > > from django.test import TestCase > > class MyTest(TestCase): > > def my_test(self): > url = ... location of my view ... > self.

Django test client encoding of JSON Booleans

2014-02-21 Thread Daniel Smith
I'm using Django version 1.5.5. Here is a short snippet of the test I'm writing: from django.test import TestCase class MyTest(TestCase): def my_test(self): url = ... location of my view ... self.client.post(url, data={'active': False}, format='json') The problem I'm running into is

Re: Inconsistent Django test results depending upon how the test is called in Django 1.5.1 running on Python 2.7.4

2013-12-04 Thread Russell Keith-Magee
On Mon, Dec 2, 2013 at 4:41 PM, Paul Whipp wrote: > Hi Russ, > > Thanks for your detailed response, deserving of this detailed > investigation: > > I eventually found that it is the simple declaration of a model within the > test suites that is causing the problem: > > django.contrib.contents.tes

Re: Inconsistent Django test results depending upon how the test is called in Django 1.5.1 running on Python 2.7.4

2013-12-02 Thread Paul Whipp
app is tested but fail when the tests for the entire project are run: >> >> (lsapi)~ $ django test >> Creating test database for alias 'default'... >> ...

Re: Inconsistent Django test results depending upon how the test is called in Django 1.5.1 running on Python 2.7.4

2013-12-01 Thread Russell Keith-Magee
On Mon, Dec 2, 2013 at 8:24 AM, Paul Whipp wrote: > I have test cases that pass when tested individually, pass when the full > app is tested but fail when the tests for the entire project are run: > > (lsapi)~ $ django test > Creating test database for

Inconsistent Django test results depending upon how the test is called in Django 1.5.1 running on Python 2.7.4

2013-12-01 Thread Paul Whipp
I have test cases that pass when tested individually, pass when the full app is tested but fail when the tests for the entire project are run: (lsapi)~ $ django test Creating test database for alias 'de

How to send xml payload by django test client?

2013-05-18 Thread Adam
Hi, I am new to Django and Python...That is not a very good point for me to start up a new Django based web application. I am trying my best to learn how to work with Django. If this is a stupid question, please forgive my ignorance. How could I send a xml payload by Django test client to my

ANN: pytest-django 2.0.0 released - a better Django test runner

2012-12-04 Thread Andreas Pelme
Hi, We are pleased to announce the availability of pytest-django 2.0.0. This release is rewritten to make use of fixture API introduced in py.test 2.3, which fixes a lot of bugs and edge cases in previous releases. Get it directly from PyPI or install with pip: pip install -U pytest-django py

Re: can the Django test server serve cgi scripts?

2012-05-13 Thread Russell Keith-Magee
On Mon, May 14, 2012 at 2:15 AM, Gelonida N wrote: > I know, that performance would be entire crap. > However sometimes this could be useful for a minimalist setup. > > So let me explain: > > For testing I'd like start no web server at all, just the django test > server

can the Django test server serve cgi scripts?

2012-05-13 Thread Gelonida N
I know, that performance would be entire crap. However sometimes this could be useful for a minimalist setup. So let me explain: For testing I'd like start no web server at all, just the django test server. (./manage.py ./runserver ) It will handle all static files and all django views.

django 1.3 and django-test-utils Persistent Database Test Runner

2011-11-25 Thread Gelonida N
I just discovered django-test-utils on the web and noticed, that it has some functionality, that looks interesting to me. http://readthedocs.org/docs/django-test-utils/en/latest/keep_database_runner.html# this shall introduce a management command 'quicktest', which is supposed to kee

Re: template list empty in with django test client

2011-08-28 Thread Juan Pablo Romero Méndez
My fault. I was testing from the console. Within an actual test the request does have the templates. Juan Pablo El día 28 de agosto de 2011 17:50, Juan Pablo Romero Méndez escribió: > Hello, > > I'm using the django test client, like this: > >>>> c = Client()

template list empty in with django test client

2011-08-28 Thread Juan Pablo Romero Méndez
Hello, I'm using the django test client, like this: >>> c = Client() >>> r = c.get("/content/new/") >>> r.status_code 200 >>> r.templates [] Is this normal? Regards, Juan Pablo -- You received this message because you are subscribed to

Re: Django Test Corrupted Test Data

2011-08-20 Thread Malcolm Box
that the tests affect each other (when ran in a series)? > > > > Sent from my BlackBerry® from Vodafone > > > > -Original Message- > > From: dm03514 > > > > Sender: django-users@googlegroups.com > > Date: Fri, 19 Aug 2011 12:13:24 > > To:

Re: Django Test Corrupted Test Data

2011-08-19 Thread patjenk
users@googlegroups.com > Date: Fri, 19 Aug 2011 12:13:24 > To: Django users > Reply-To: django-users@googlegroups.com > Subject: Django Test Corrupted Test Data > > I have a test class that subclasses django.test.TestCase which has > about 5 different tests in it. When I run my fu

Re: Django Test Corrupted Test Data

2011-08-19 Thread bikkit
Could it be that the tests affect each other (when ran in a series)? Sent from my BlackBerry® from Vodafone -Original Message- From: dm03514 Sender: django-users@googlegroups.com Date: Fri, 19 Aug 2011 12:13:24 To: Django users Reply-To: django-users@googlegroups.com Subject: Django

Django Test Corrupted Test Data

2011-08-19 Thread dm03514
I have a test class that subclasses django.test.TestCase which has about 5 different tests in it. When I run my full test suite (using nose, and specifying sqlite as backend) there are a series of failures. When I go to debug the tests, running them individually, they pass fine. http://stackoverfl

Re: spawning threads within test cases in django test framework

2011-06-01 Thread Brian
Thanks for the replies. I realised that I could reorganise the code so that all the database updating was done in the main thread. Re TransactionTestCases, I knew I'd read something related to that but didn't find it when I went looking yesterday evening; it sounds like that would have worked i

Re: spawning threads within test cases in django test framework

2011-06-01 Thread Kirill Spitsin
On Tue, May 31, 2011 at 02:01:00PM -0700, Brian wrote: > I've got a django app with a periodically scheduled background task that > updates the database. I've written a bunch of tests for its principal class > that are run as part of the django unit test framework. I want to convert > the class

Re: spawning threads within test cases in django test framework

2011-06-01 Thread Duane Griffin
On 31 May 2011 22:01, Brian wrote: > I've got a django app with a periodically scheduled background task that > updates the database. I've written a bunch of tests for its principal class > that are run as part of the django unit test framework. I want to convert > the class to do its work using m

spawning threads within test cases in django test framework

2011-05-31 Thread Brian
I've got a django app with a periodically scheduled background task that updates the database. I've written a bunch of tests for its principal class that are run as part of the django unit test framework. I want to convert the class to do its work using multiple threads, but I'm having trouble

Re: django test framework with no models.py

2010-12-30 Thread Seth Gordon
On 12/27/2010 09:58 AM, Henrik Genssen wrote: > Hi, > > I wanted to write a test for an app, that does not have a models.py itself. > Doing so I get: > django.core.exceptions.ImproperlyConfigured: App with label service could not > be found > > if I create a models.py with just a "pass" in it ev

Re: django test framework with no models.py

2010-12-27 Thread Karen Tracey
On Mon, Dec 27, 2010 at 9:58 AM, Henrik Genssen wrote: > I wanted to write a test for an app, that does not have a models.py itself. > Doing so I get: > django.core.exceptions.ImproperlyConfigured: App with label service could > not be found > > if I create a models.py with just a "pass" in it eve

django test framework with no models.py

2010-12-27 Thread Henrik Genssen
Hi, I wanted to write a test for an app, that does not have a models.py itself. Doing so I get: django.core.exceptions.ImproperlyConfigured: App with label service could not be found if I create a models.py with just a "pass" in it everything works as expected. I use Django 1.1 Is this a bug or

Re: Working with URL Fields in django test.

2010-07-26 Thread Steve Holden
On 2/9/2009 5:14 AM, Vitaly Babiy wrote: > Hello, > > If I am using a URLField in form and it set to verify the URL, if I > write tests for the code and in the post I push a url like > /http:google.com /it will fail if the computer is > off-line. Is there a good fix for this? >

Re: I am having issues with django test

2010-03-29 Thread Phlip
>     def setUp(self): >         user = User.objects.create_user(USER, '@nowhere.com', PASS) That's what fixtures are for! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. T

Re: I am having issues with django test

2010-03-29 Thread Paulo Almeida
This doesn't answer your question, but it may help you solve the problem. I have this class in my tests: class LoggedInUser(TestCase): def setUp(self): user = User.objects.create_user(USER, 'm...@nowhere.com', PASS) self.client.login(username=user.username, password=PASS)

Re: I am having issues with django test

2010-03-27 Thread Rolando Espinoza La Fuente
On Sat, Mar 27, 2010 at 9:30 PM, Mohamed Ainab wrote: > I have this test case > >    def test_loginin_student_control_panel(self): >        c = Client() >        c.login(username="tauri", password="gaul") >        response = c.get('/student/') >        self.assertEqual(response.status_code, 200)

I am having issues with django test

2010-03-27 Thread Mohamed Ainab
I have this test case def test_loginin_student_control_panel(self): c = Client() c.login(username="tauri", password="gaul") response = c.get('/student/') self.assertEqual(response.status_code, 200) the view associated with the test case is this @login_required

Re: django-test-coverage gcc error

2010-03-11 Thread Karen Tracey
On Thu, Mar 11, 2010 at 6:50 AM, filias wrote: > Thanks Karen, I am using ubuntu karmic. I will search for the package > that I need. > > On Ubuntu it's python-dev that you need. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: django-test-coverage gcc error

2010-03-11 Thread filias
ilias wrote: > > > I am trying to use a test coverage tool for django. > > > > I triedhttp://pypi.python.org/pypi/django-test-coverage/0.1. First > > > with easy_install and after with setup.py install and I get the > > > following error stack: > > &g

Re: django-test-coverage gcc error

2010-03-11 Thread filias
Thanks Karen, I am using ubuntu karmic. I will search for the package that I need. On Mar 10, 4:34 pm, Karen Tracey wrote: > On Wed, Mar 10, 2010 at 11:13 AM, filias wrote: > > I am trying to use a test coverage tool for django. > > > I triedhttp://pypi.python.org/pypi/django

Re: django-test-coverage gcc error

2010-03-10 Thread Karen Tracey
On Wed, Mar 10, 2010 at 11:13 AM, filias wrote: > I am trying to use a test coverage tool for django. > > I tried http://pypi.python.org/pypi/django-test-coverage/0.1. First > with easy_install and after with setup.py install and I get the > following error stack: > > Sear

django-test-coverage gcc error

2010-03-10 Thread filias
I am trying to use a test coverage tool for django. I tried http://pypi.python.org/pypi/django-test-coverage/0.1. First with easy_install and after with setup.py install and I get the following error stack: Searching for django-test-coverage Best match: django-test-coverage 0.1 Processing

Re: How can I add the Openid session data to the Django test client Client.post() ?

2010-02-25 Thread br...@instantdirectmarketing.com
I looked at how the Django test client class method, Client.login() stored sessions and attempt to copy the important sections into the test so the session data could be stored. When I broke into the test immediately before Client.post() was called and the session looked OK. ipdb> request.sess

How can I add the Openid session data to the Django test client Client.post() ?

2010-02-24 Thread br...@instantdirectmarketing.com
I'm trying to test that a UserProfile model is created as a new User is registered in django_authopenid. I don't understand how to add the Openid session data to the POST. class UserTestCase(TestCase): def test_register_should_create_UserProfile(self): from django.test.client imp

Re: Django Test Server and threading

2010-02-01 Thread schinckel
On Feb 2, 3:05 am, Cristiano Paris wrote: > On Mon, Feb 1, 2010 at 12:33 PM, Ramiro Morales wrote: > > ... > > Are you using sqlite3? > > Yes but, isn't the test server always using sqlite3? > No. The test server uses (unless told otherwise) the same db backend as the regular server. Matt. --

Re: Django Test Server and threading

2010-02-01 Thread Cristiano Paris
On Mon, Feb 1, 2010 at 12:33 PM, Ramiro Morales wrote: > ... > Are you using sqlite3? I think I understand why you're asking this. Here's a little test I ran: - import sqlite3,thread from time import sleep conn = sqlite3.connect(':memory:') c = conn.cursor() c.execute('''create table stock

Re: Django Test Server and threading

2010-02-01 Thread Cristiano Paris
On Mon, Feb 1, 2010 at 12:33 PM, Ramiro Morales wrote: > ... > Are you using sqlite3? Yes but, isn't the test server always using sqlite3? Cristiano -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

  1   2   >