Django Tests (--parallel) flag issues

2019-11-13 Thread Oscar Chacon
I've been working on trying to set up my tests to run in parallel, however I've experienced some issues along the way. I've tried setting the parallel flag in the options for the django tests, and while it creates the copies of the db, it only creates the main thread and ru

Re: Django tests appear to be getting substantially slower

2019-06-16 Thread Simon Charette
Again, it's hard to tell what the slowdown might be caused by without a more detailed investigation. I suggest you use cProfile[0] for that. Given your tests are only running for a small amount of time relative to Django's setup time I assume two things are causing the apparent slowdown: 1. A s

Re: Django tests appear to be getting substantially slower

2019-06-15 Thread Mark Jones
Ah, but the slowdown is happening from 1.8 forward, each version of Django make things just a bit slower. It's a gradual slowdown. I do think I've got 3.2x libsqlite though. So we can account for the slowdown on 2.1 -> 2.2 /usr/lib/libsqlite3.0.dylib /usr/lib/libsqlite3.dylib /usr/local/Cellar/

Re: Django tests appear to be getting substantially slower

2019-06-15 Thread Simon Charette
I meant Django 2.0 -> 2.1. As long as you are using Django 2.2 with SQLite 3.20+ the slowdown I mentioned should be effective. Simon Le samedi 15 juin 2019 08:32:56 UTC-4, Mark Jones a écrit : > > Maybe that's the case, I didn't build the python2.7 or 3.7, but I used > pyenv to install 3.4, 3.5

Re: Django tests appear to be getting substantially slower

2019-06-15 Thread Mark Jones
Maybe that's the case, I didn't build the python2.7 or 3.7, but I used pyenv to install 3.4, 3.5, and 3.6 and they are all using the same version of SQLite. And with each version of python, the tests slow down as the version of django increases. Could this still be the SQLite v2.1->v2.2? Django

Re: Django tests appear to be getting substantially slower

2019-06-15 Thread Simon Charette
Hi Mark, It's hard to tell exactly what's going on without more details but assuming you are running tests against SQLite the 2.1 to 2.2 slowdown is likely caused by the fact database constraints are now checked of each TestCase[0]. Cheers, Simon [0] https://docs.djangoproject.com/en/2.2/relea

Django tests appear to be getting substantially slower

2019-06-15 Thread Mark Jones
I was fixing up a Django app https://github.com/mark0978/django-softdelete and setting up tox to make sure it worked with all the listed versions because of issues opened on the original repo. While I was running tox locally I noticed that with every version of Django, the tests ran slower, and

django tests - model instance not created

2019-05-09 Thread luca bocchi
I'm experiencing issues on creating fixtures for a particular model in a test class with Django and the DRF. I'm using model-mommy , but even creating a single instance just using the Django ORM for that model does not work: *from

Re: Running django tests with postgres

2018-09-18 Thread Mike Dewhirst
Bill I'm about to disappear for a few days. Thank you very much for your suggestions - I'll tackle them when I get back. Cheers Mike On 18/09/2018 11:34 PM, Bill-Torcaso-Oxfam wrote: I two comments, and as always Your Milage May Vary. * I wonder if you have the right indexes on your Pos

Re: Running django tests with postgres

2018-09-18 Thread Bill-Torcaso-Oxfam
I two comments, and as always Your Milage May Vary. - I wonder if you have the right indexes on your Postgres database? The previous people report much faster completion times for test that use Postgres as the database. Perhaps your domain is just hard (and you description makes

Re: Running django tests with postgres

2018-09-15 Thread Mike Dewhirst
My software classifies chemical hazards according to intrinsic physical properties. This requires accessing large quantities of reference data imported from jurisdictions around the world. The tests demand correct classification for known properties. There are dozens of different classificatio

Re: Running django tests with postgres

2018-09-15 Thread Jason
Agreed. Something is definitely off. At work, the legacy monolith django app has about 7800 tests. It takes about 18 minutes to run the full test suite in docker with the latest MBP (four cores, 5GB RAM allocated in docker machine), including creating the db and four parallel test streams ru

Re: Running django tests with postgres

2018-09-15 Thread Andréas Kühne
I would just be scared that some minor issues are different between the database implementations - therefore some test that would work in the tests and during development, doesn't work in production. I usually try to use the same things in production and development (or as close as possible). Tha

Re: Running django tests with postgres

2018-09-14 Thread Mike Dewhirst
+1 Andréas One of my projects runs (currently) 1,248 tests using SQLite3 in 72 minutes on my local Windows 10 dev laptop. That laptop has both a SSD and a hard disk. Foolishly I opted to use the SSD for software installations and the hard disk for development and thus the tests. I was concern

Re: Running django tests with postgres

2018-09-14 Thread Andréas Kühne
Hi, Just my 5 cents. I think you are doing the tests wrong. I don't believe that doing testing against hard coded values is at all correct - and it isn't actually that hard to change the tests to a simpler way. The values of the PK's aren't really necessary for your test to be true either - how do

Running django tests with postgres

2018-09-14 Thread Hezi Halpert
I would like to share with you an issue we encounter while moving from sqlite to postgres with heavily use of Django testing. We have Django app with ~700 tests. Most of them accessing database. We recently migrated the database from sqlite to postgres. Many of our tests were written in a way t

Re: Django tests and token timeout

2018-07-30 Thread Birger Schacht
fine grained. Is there a way to test such a timeout in Django tests, >> i.e. something that lets the unit test use a fake time in the future? >> > > You can mock out pretty much everything using the mock module in the > standard Python unittest library that Django already uses.

Re: Django tests and token timeout

2018-07-30 Thread Kasper Laudrup
Hi Birger, On 2018-07-30 16:12, Birger Schacht wrote: i'm using my own PasswordResetTokenGenerator which has a timeout that is not given in days but hours, to make the password token timeout more fine grained. Is there a way to test such a timeout in Django tests, i.e. something that let

Re: Django tests and token timeout

2018-07-30 Thread Adam Stein
PasswordResetTokenGenerator which has a timeout that > is > not given in days but hours, to make the password token timeout more > fine grained. Is there a way to test such a timeout in Django tests, > i.e. something that lets the unit test use a fake time in the future? > > c

Django tests and token timeout

2018-07-30 Thread Birger Schacht
hi, i'm using my own PasswordResetTokenGenerator which has a timeout that is not given in days but hours, to make the password token timeout more fine grained. Is there a way to test such a timeout in Django tests, i.e. something that lets the unit test use a fake time in the future? c

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-26 Thread Melvyn Sopacua
On donderdag 26 juli 2018 02:35:01 CEST Gene wrote: > Preventing code from using networking is a common approach for unit tests > Firewall is a completely different story and has nothing common with this > matter It does, because he's looking for a catch-all button. If you read the entire thread

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-25 Thread Gene
:48 UTC+8, Kum wrote: > > Hi, > > Is there a global config I can enable to prevent any Django tests in a > project from accessing the internet (i.e., only allow network calls to > localhost) ? > > Thanks > -- You received this message because you are subscribed to the G

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-25 Thread Gene
Preventing code from using networking is a common approach for unit tests Firewall is a completely different story and has nothing common with this matter On Thursday, 26 July 2018 04:50:58 UTC+8, Melvyn Sopacua wrote: > > On dinsdag 24 juli 2018 04:21:07 CEST Kum wrote: > > Is there a way to pr

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-25 Thread Melvyn Sopacua
On dinsdag 24 juli 2018 04:21:07 CEST Kum wrote: > Is there a way to prevent people from accidentally doing so? To prevent network access, there are firewalls. Django isn't the thing for it. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Djang

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-24 Thread Gene
INTEGRATION_TESTS = True (or False in unit test settings) and then, test functions can be decorated like @skipUnless(settings.INTEGRATION_TESTS) On Monday, 23 July 2018 19:04:48 UTC+8, Kum wrote: > > Hi, > > Is there a global config I can enable to prevent any Django tests in a > project

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-24 Thread Derek
Have a switch that is set to OFF by default (then your tests will switch to using a mocked approach) and then have test that can only be be run with direct access to the API if you deliberately set it ON. No "accidents". On Tuesday, 24 July 2018 04:21:07 UTC+2, Kum wrote: > > Is there a way to

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Kum
Is there a way to prevent people from accidentally doing so? On Monday, July 23, 2018 at 7:39:27 AM UTC-4, Jason wrote: > > you shouldn't be accessing external services with your tests, you should > mock or patch them with expected responses/failures and test based on that. > -- You received th

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Melvyn Sopacua
On maandag 23 juli 2018 17:23:20 CEST chuck.horow...@packetviper.us wrote: > Hi Kum, > > I think Melvyn's suggestion is a good one. Is there any reason you > couldn't do: > > > import DEBUG from yourapp.settings > > > And then check against that for your testing? Here's some code I used in a

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread chuck . horowitz
Hi Kum, I think Melvyn's suggestion is a good one. Is there any reason you couldn't do: import DEBUG from yourapp.settings And then check against that for your testing? On Monday, July 23, 2018 at 8:22:17 AM UTC-4, Melvyn Sopacua wrote: > > On maandag 23 juli 2018 13:39:27 CEST Jason wrote

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Melvyn Sopacua
On maandag 23 juli 2018 13:39:27 CEST Jason wrote: > you shouldn't be accessing external services with your tests Non-sense. Part of interacting with a remote API is making sure it works and they didn't change anything (trust me, there's plenty of API's that change without changing version numbe

Re: Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Jason
you shouldn't be accessing external services with your tests, you should mock or patch them with expected responses/failures and test based on that. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Prevent Django tests from accessing internet (except localhost)

2018-07-23 Thread Kum
Hi, Is there a global config I can enable to prevent any Django tests in a project from accessing the internet (i.e., only allow network calls to localhost) ? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Django tests fails - migration error

2017-12-09 Thread Matej Šnuderl
Since upgrading to Django 2.0 I'm getting SQL error while trying to run python manage.py test. (rest) λ → ✘ msnuderl@Matejs-MBP  ~/Workspace/Personal/homsterNoi   master ●  python manage.py test Creating test database for alias 'default'... Got an error creating the test database: database

Re: Running Django tests for postgres_tests

2016-07-20 Thread Tim Graham
You need to use a custom settings module that uses the postgresql database backend. https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#using-another-settings-module On Tuesday, July 19, 2016 at 11:37:35 PM UTC-4, premdjango wrote: > > I'm trying to

Running Django tests for postgres_tests

2016-07-19 Thread premdjango
I'm trying to run django tests for a particular module - postgres_tests. The tests runs but it says it skipped=312 tests, I believe none of the test case run. How do I fix this issue? (djangodev) Anands-MBP:tests laks$ ./runtests.py postgres_tests Testing against Django install

Re: Django tests failing for development env

2016-06-28 Thread Tim Graham
the tests and get the following output - > > == > > FAIL: test_old_style_storage (file_storage.tests.FileFieldStorageTests) > > -- > > Traceback (most recent call last): > > File > &qu

Django tests failing for development env

2016-06-28 Thread premdjango
: test_old_style_storage (file_storage.tests.FileFieldStorageTests) -- Traceback (most recent call last): File "/Users/prem/Documents/django-contribute/django/tests/file_storage/tests.py", line 566, in test_old_sty

Re: Working with HstoreField in django tests

2016-05-15 Thread Denis Boyarkin
Yes, It helped, thank you. If you're on Stackowerflow you can answer this question:this question <http://stackoverflow.com/questions/37200489/working-with-hstorefield-in-django-tests> . понедельник, 16 мая 2016 г., 9:22:50 UTC+8 пользователь Simon Charette написал: > > Hi De

Re: Working with HstoreField in django tests

2016-05-15 Thread Simon Charette
Hi Denis, >From the exception it looks like the issue is not related to a missing extension but from an attempt of using and integer as a key. e.g. instance.hstore_field = {1: 'foo'} instead of instance.hstore_field = {'1': 'foo'} Cheers, Simon Le dimanche 15 mai 2016 21:11:33 UTC-4, Denis

Working with HstoreField in django tests

2016-05-15 Thread Denis Boyarkin
I'm using HstoreField in one of my models and when I try to test it I got an error psycopg2.ProgrammingError: ERROR: function hstore(integer[], text[]) does not exist. If I understand this problem correctly it happend because hstore extension wasn't setup in database as it was did in migratio

Django tests on postgresql with fixtures

2016-03-09 Thread Dheerendra Rathor
According to django testing docs - database is flushed after each TestCase. It is working fine when I'm using sqlite for testing. But database is not flushed when using postgresql and testcases are failing since it is trying to load fixtures which have been loaded in previous TestCase. Is ther

unable to run django tests

2016-01-11 Thread varun naganathan
HI, I recently switched my laptop.I have run django unittests previously also. Im using the command "PYTHONPATH=..:$PYTHONPATH ./runtests.py bug1233" it shows me an error : Please install test dependencies first: $ pip install -r requirements/py2.txt however when i run the pip install command: i

InterfaceError: connection already closed from psycopg2 when running Django Tests

2015-08-11 Thread TheBeardedTemplar
I'm trying to implement testing on a fairly large Django site, and I'm encountering a psycopg2 error when running all the tests at once using `python manage.py test`. If I specify each app name individually, it works fine (some tests fail, but all for legitimate reasons), however when I run the

Re: django tests, mongoengine, and unique_with constraint

2014-02-25 Thread Loutre
It works if I call insure_indexes() method. I can't understand why. Is there to avoid it ? My code that works : > > from django.test import TestCase > from les_classiques.models import Author > import mongoengine > > > class DatabaseTest(TestCase): > def setUp(self): > db = mongoengi

Re: django tests, mongoengine, and unique_with constraint

2014-02-25 Thread Loutre
> > I realized that indexes have not been created by mongoengine : > db.author.getIndexes() [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "poesie.author", "name" : "_id_" } ] I'm s

Re: django tests, mongoengine, and unique_with constraint

2014-02-25 Thread Loutre
> > NB : I use Python 3.3.4, mongoengine 0.8.7, Django 1.6.2 and mongodb 2.0.6 > -- 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...@google

django tests, mongoengine, and unique_with constraint

2014-02-25 Thread Loutre
Hi everybody, I'm facing the following problem with Mongodb. I've got the following model : from mongoengine import Document, StringField, DateTimeField class Author(Document): name = StringField(max_length=50, required=True) first_name = StringField(max_length=50, required=True, un

Django tests namespace error

2014-02-04 Thread Danil Galeev
Hi guys, I have django 1.6.1 project which uses django rest framework and I work around building api. I covered api calls by unittests and I have one problem. Application name is 'api' and all tests are passed when I run tests using command: python manage.py test api But when I run all projec

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django', 'USER': 'matt', 'PASSWORD':'***', 'HOST': '127.0.0.1', 'PORT': '5432', }, 'OPTIONS': { 'autocommit': True, } I forgot to post DB settings On Wedn

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
Django is 1.6 and Python is 2.7.5. On Windows 8.1, no virtual-env, but my actual project will be on a *nix VM. I accidentally download and install a development version, I think removed it before installing 1.6 but no previous django versions were installed on this system. Maybe dropping my db

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Thomas Lockhart
On 12/4/13 9:18 AM, Matt Schloepp wrote: I'm running Django on Windows with PostgreSQL database. I'm in tutorial 5 and have copy/pasted the code after it's initial failure. I've been following the tutorials to this point, with only a little side experimentation, and everything has been working.

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
Commenting out my Postgresql DB and putting back the default options for the sqlite DB fixed the issue. Is there a tests.py variable I could use to create an If..Else that would allow this to be automatic and not force me to edit my settings.py every time I wanted to run a test. -- You recei

Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
I'm running Django on Windows with PostgreSQL database. I'm in tutorial 5 and have copy/pasted the code after it's initial failure. I've been following the tutorials to this point, with only a little side experimentation, and everything has been working. It looks like it DB related since I'm no

Re: django tests

2013-11-23 Thread Felipe Coelho
2013/11/23 Harjot Mann > On Sat, Nov 23, 2013 at 2:49 PM, Simone Dalla wrote: > > the correct code should be > > > > ... > > self.userprofile = UserProfile.objects.filter(user_id =1) > > self.userprofile.update(first_name = "Harjot") > > ... > > self.assertEqual(self.userprofile.user_id, 1) > >

Re: django tests

2013-11-23 Thread Harjot Mann
On Sat, Nov 23, 2013 at 2:49 PM, Simone Dalla wrote: > the correct code should be > > ... > self.userprofile = UserProfile.objects.filter(user_id =1) > self.userprofile.update(first_name = "Harjot") > ... > self.assertEqual(self.userprofile.user_id, 1) New Error. Traceback (most recent call last)

Re: django tests

2013-11-23 Thread Simone Dalla
2013/11/23 Harjot Mann > Now my code is this: > class UserProfileTestCase(TestCase): > def setUp(self): > self.userprofile = UserProfile.objects.filter(user_id = > 1).update(first_name = "Harjot") > > def test_profile(self): > self.assertEqual(self.userprofile.user_id, 1)

Re: django tests

2013-11-23 Thread Harjot Mann
Now my code is this: class UserProfileTestCase(TestCase): def setUp(self): self.userprofile = UserProfile.objects.filter(user_id = 1).update(first_name = "Harjot") def test_profile(self): self.assertEqual(self.userprofile.user_id, 1) and I am getting this error: Traceback (

Re: django tests

2013-11-23 Thread Harjot Mann
On Sat, Nov 23, 2013 at 7:53 AM, Arun K Reddy wrote: > add any other not optional fields. Hope it works. Same error. Even on adding from django.contrib.auth import User Import error is giving. -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress.c

Re: django tests

2013-11-22 Thread Arun K Reddy
> > Simple, first create a user model and do the following: from django.contrib.auth import User class UserProfileTestCase(TestCase): def setup(self): self.user = User.objects.filter(pk=1) self.userprofile = UserProfile.objects.create(first_name = "H

Re: django tests

2013-11-22 Thread Xavier Ordoquy
Hi, Tests are regular Python code using Django. The code shouldn’t be different from what you write elsewhere. You’ll find some example about using foreign key by the end of the first tutorial page. In your case, it looks like you’ll need to create a user and add it to the model you are testing

Re: django tests

2013-11-22 Thread Harjot Mann
On Fri, Nov 22, 2013 at 1:47 PM, Xavier Ordoquy wrote: > I feel like you are trying to get too fast into Django. > It looks like you should take some time and read the Django’s documentation. > It is written like a book and would give an accurate view of what’s going on. > If things are still not

Re: django tests

2013-11-22 Thread Xavier Ordoquy
Hi, I feel like you are trying to get too fast into Django. It looks like you should take some time and read the Django’s documentation. It is written like a book and would give an accurate view of what’s going on. If things are still not clear after that, we’d be interested to hear from it and

Re: django tests

2013-11-21 Thread Harjot Mann
On Fri, Nov 22, 2013 at 1:13 PM, Charly Román wrote: > Yes, you need to give all the fields that arent't optional. Included > foreign keys. Not optional means that are not validated. If yes why? I mean these are the compulsory fields, so why we should not give it. I used all the compulsory field

Re: django tests

2013-11-21 Thread Charly Román
Yes, you need to give all the fields that arent't optional. Included foreign keys. 2013/11/22 Harjot Mann : > On Fri, Nov 22, 2013 at 12:50 PM, Charly Román wrote: >> It's because you have fields in your model that aren't optional, and >> in your code you only set one field. > > > Ok so I need to

Re: django tests

2013-11-21 Thread Harjot Mann
On Fri, Nov 22, 2013 at 12:50 PM, Charly Román wrote: > It's because you have fields in your model that aren't optional, and > in your code you only set one field. Ok so I need to give alll the fields and it is having foreign key constraint I think, so for that I need to use that also? -- Harj

Re: django tests

2013-11-21 Thread Charly Román
It's because you have fields in your model that aren't optional, and in your code you only set one field. 2013/11/22 Harjot Mann : > On Fri, Nov 22, 2013 at 12:13 PM, Xavier Ordoquy wrote: >> I doubt the error is the same although it might look similar. >> Please note that TestCase use setUp in

Re: django tests

2013-11-21 Thread Harjot Mann
On Fri, Nov 22, 2013 at 12:13 PM, Xavier Ordoquy wrote: > I doubt the error is the same although it might look similar. > Please note that TestCase use setUp instead of setup. Oh thankyou. But now I am getting a long list of errors. http://tny.cz/c4018552 -- Harjot Kaur Mann Blog: http://harjo

Re: django tests

2013-11-21 Thread Xavier Ordoquy
Hi, I doubt the error is the same although it might look similar. Please note that TestCase use setUp instead of setup. Regards, Xavier Ordoquy, Linovia. Le 22 nov. 2013 à 07:17, Harjot Mann a écrit : > On Fri, Nov 22, 2013 at 11:17 AM, Charly Román wrote: >> Your testcase's name and model's

Re: django tests

2013-11-21 Thread Charly Román
http://tny.cz/c883f980 You need to read about OOP in Python. 2013/11/22 Charly Román : > http://tny.cz/c883f980 > > > You need to rea about OOP in Python. > > > > 2013/11/22 Harjot Mann : >> On Fri, Nov 22, 2013 at 11:17 AM, Charly Román wrote: >>> Your testcase's name and model's name its the

Re: django tests

2013-11-21 Thread Charly Román
http://tny.cz/c883f980 You need to rea about OOP in Python. 2013/11/22 Harjot Mann : > On Fri, Nov 22, 2013 at 11:17 AM, Charly Román wrote: >> Your testcase's name and model's name its the same, fix this. > > > Changed it. But still getting the same error. Now the code is this: > http://tny.

Re: django tests

2013-11-21 Thread Harjot Mann
On Fri, Nov 22, 2013 at 11:17 AM, Charly Román wrote: > Your testcase's name and model's name its the same, fix this. Changed it. But still getting the same error. Now the code is this: http://tny.cz/941266d9 -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjot

Re: django tests

2013-11-21 Thread Charly Román
Your testcase's name and model's name its the same, fix this. 2013/11/21 Harjot Mann : > I am creating tests for my django app. Here is my test and I am > getting an error. > Here is my test code. > UserProfile is my model name and profile is my view corresponding to that. > > http://tny.cz/82ce97

django tests

2013-11-21 Thread Harjot Mann
I am creating tests for my django app. Here is my test and I am getting an error. Here is my test code. UserProfile is my model name and profile is my view corresponding to that. http://tny.cz/82ce97ef This is the error I am getting ERROR: test_profile (Automation.tcc.tests.UserProfile) -

[ANN] Django-Tests-Assistant

2013-10-13 Thread Amirouche Boubekki
ks on firefox, so if you know javascript and jquery you might help by fixing it (wired GC bug I think). Thanks in advance. Anyway, have a good use of this app! Cheers, Amirouche [1] https://github.com/tests-assistant/tests-assistant/ [2] https://pypi.python.org/pypi/django-tests-assis

Can I run django tests in pydev's pyunit view?

2012-08-29 Thread jyria
Im used to JUnit testing in eclipse and Im wondering if I can hook up pyunit view with django tests. I would like to start my tests effortlessly within eclipse, pressing Ctrl+F11 or something like that and get red or a green bar. Currently I'm running tests in console and colorize output

Re: django tests. where to create users

2011-11-30 Thread Gelonida N
I create this object, either in > test or the setUp. > > On 11/28/11 01:58, Gelonida N wrote: >> Hi, >> >> I'd like to run some django tests, which use the test client and which >> should check, that certain users can only access certain contents. >> >&

Re: django tests. where to create users

2011-11-30 Thread Gelonida N
On 11/29/2011 11:45 AM, Tom Christie wrote: > What's wrong with just creating them in the .setUp()? > > Don't sweat the small amount of time it'll take to re-create the users > on each test run, it's almost certainly not worth worrying about. > Well this is what I'm doing at the moment. And I th

Re: django tests. where to create users

2011-11-29 Thread Piotr Zalewa
58, Gelonida N wrote: Hi, I'd like to run some django tests, which use the test client and which should check, that certain users can only access certain contents. Where would you create this users / passwords. - With a fixture - as part of a test class in the SetUp section and tear it do

Re: django tests. where to create users

2011-11-29 Thread Tom Christie
What's wrong with just creating them in the .setUp()? Don't sweat the small amount of time it'll take to re-create the users on each test run, it's almost certainly not worth worrying about. -- You received this message because you are subscribed to the Google Groups "Django users" group. To v

Re: django tests. where to create users

2011-11-28 Thread Mike Dewhirst
On 29/11/2011 12:12pm, Gelonida N wrote: So it seems, I am stuck with fixtures at least at the moment I do not know how to create users without fixtures such, that they would be persistent between unit tests. I agree - you are stuck. Perhaps a two tier approach might work. If you bite the bul

Re: django tests. where to create users

2011-11-28 Thread Gelonida N
On 11/28/2011 01:58 AM, Gelonida N wrote: > Hi, > > I'd like to run some django tests, which use the test client and which > should check, that certain users can only access certain contents. > > Where would you create this users / passwords. > - With a fixture > - a

django tests. where to create users

2011-11-27 Thread Gelonida N
Hi, I'd like to run some django tests, which use the test client and which should check, that certain users can only access certain contents. Where would you create this users / passwords. - With a fixture - as part of a test class in the SetUp section and tear it down afterwards? - c

django tests and namespaced reversed urls

2011-07-05 Thread Mateusz Harasymczuk
I have a problem with tests and namespaced reversed urls. It fails tests. However when running a server they works properly. I have tried #urls.py url(r'^', include('ns.urls', namespace="ns"), name="ns"), #ns/urls.py url(r'name/$', NameView.as_view(), name='home'), #template.html {% url ns:home

Re: Running Django tests from Python

2011-04-27 Thread Shawn Milochik
On 04/27/2011 04:06 PM, Kenny Meyer wrote: Hi Shawn, http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code Does this answer your question? Kenny Never mind. More pdb action and I figured out that I had overwritten DJANGO_SETTINGS_MODULE at the bas

Re: Running Django tests from Python

2011-04-27 Thread Shawn Milochik
On 04/27/2011 04:06 PM, Kenny Meyer wrote: Hi Shawn, http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code Does this answer your question? Kenny Kenny, This is *exactly* what I was looking for. Unfortunately it doesn't work. It keeps saying that

Re: Running Django tests from Python

2011-04-27 Thread Kenny Meyer
Hi Shawn, http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code Does this answer your question? Kenny On Wed, Apr 27, 2011 at 12:41 PM, Shawn Milochik wrote: > Sorry, I realize that last post is missing the context of the original > question. > Ple

Re: Running Django tests from Python

2011-04-27 Thread Shawn Milochik
Sorry, I realize that last post is missing the context of the original question. Please see this: https://groups.google.com/d/topic/django-users/-4f3J1bJ10k/discussion Thanks, Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Running Django tests from Python

2011-04-27 Thread Shawn Milochik
I figure it's been long enough that I can bump this post. I'm currently using subprocess to do this. There must be an easy way to simply invoke the tests from within Python. So, how do you (within Python), do the equivalent of the following?: ./manage.py test myapp1, myapp2, myapp3 Thanks,

Running Django tests from Python

2011-04-21 Thread Shawn Milochik
I want to use pyinotify[1] to monitor my project directory and run my unit tests whenever I save a .py file. The monitoring part is working. All I need now is to know how to call the tests from my "watcher" script. As noted in the docs[2], I'm already running setup_test_environment() in my scrip

Re: Current Django tests fail?

2009-10-12 Thread Russell Keith-Magee
On Mon, Oct 12, 2009 at 11:18 PM, Tim Chase wrote: > > I'm not sure why I > still only get 866 tests (my patch adds one test, bringing it to > 867) where you get 917, but at least the core passes now. This isn't necessarily an issue to be concerned about - there are some conditional tests in the

Re: Current Django tests fail?

2009-10-12 Thread Tim Chase
> I just ran the full suite usine SQLite on r11603, and got 100% pass on > 917 tests. > > I can't think of an obvious cause, but the fact that you're getting > errors in runtests.py is mighty suspicious. The fact that you've got > 50 less tests than you should is also suspicious. > > My first gu

Re: Current Django tests fail?

2009-10-12 Thread Russell Keith-Magee
On Mon, Oct 12, 2009 at 4:14 PM, Tim Chase wrote: > > Got the following while testing latest trunk and haven't touched > this file (runtests.py). > > t...@rubbish:~/code/django/trunk/tests$ python runtests.py > --settings=settings >

Re: Current Django tests fail?

2009-10-12 Thread Chris Withers
Tim Chase wrote: > Is there something obvious I missed? Hi Tim, I do wonder if you might get more help with these problems on the Django developers list? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-

Current Django tests fail?

2009-10-12 Thread Tim Chase
Got the following while testing latest trunk and haven't touched this file (runtests.py). t...@rubbish:~/code/django/trunk/tests$ python runtests.py --settings=settings == ERROR: runTest (__main__.InvalidModelTestCase)

Re: Running django tests

2009-08-10 Thread Filip Gruszczyński
Any idea, what am I doing wrong? I post the exceptions below. >> >> grusz...@gruszczy-laptop:~/django/tests# PYTHONPATH=.. > > You appear to be on a Unix-y platform so you'll need to export PYTHONPATH: > > export PYTHONPATH=.. > > so that the setting will be inherit

Re: Running django tests

2009-08-10 Thread Karen Tracey
2009/8/10 Filip Gruszczyński > > Hi! > > I would like to run django source code tests, but as soon as I do it > (after specifying the settings file), I get all kinds of exceptions. > Any idea, what am I doing wrong? I post the exceptions below. > > grusz...@gruszc

Running django tests

2009-08-10 Thread Filip Gruszczyński
Hi! I would like to run django source code tests, but as soon as I do it (after specifying the settings file), I get all kinds of exceptions. Any idea, what am I doing wrong? I post the exceptions below. grusz...@gruszczy-laptop:~/django/tests# PYTHONPATH=.. grusz...@gruszczy-laptop:~/django

Re: how fixtures can be load in django tests?

2007-11-20 Thread michel bruavics
On 20 Nov., 17:37, "Joseph Kocherhans" <[EMAIL PROTECTED]> wrote: > On 11/20/07, michel bruavics <[EMAIL PROTECTED]> wrote: > > > > > > > Hi djangos, > > > I check out the django.test.client and want to load a fixture file > > called "myfixture.xml". > > > I added in my project setting a folder

Re: how fixtures can be load in django tests?

2007-11-20 Thread Joseph Kocherhans
On 11/20/07, michel bruavics <[EMAIL PROTECTED]> wrote: > > Hi djangos, > > I check out the django.test.client and want to load a fixture file > called "myfixture.xml". > > I added in my project setting a folder (called fixtures): > FIXTURE_DIRS = ('/workspace/project/fixtures/') > > myfixture.xml

how fixtures can be load in django tests?

2007-11-20 Thread michel bruavics
Hi djangos, I check out the django.test.client and want to load a fixture file called "myfixture.xml". I added in my project setting a folder (called fixtures): FIXTURE_DIRS = ('/workspace/project/fixtures/') myfixture.xml is inside of the folder fixtures. now I try to load the fixture in my t

  1   2   >