Re: failure to load fixtures during unit tests

2016-05-09 Thread Rich Rauenzahn
FYI, I was finally able to resolve this. I had an assumption that TestCase's began with a freshly created database between TestCase classes. I asserted this in _fixture_setup() and found that assumption to be false. Upon further research I found a setUpClass() in another TestCase that

Re: failure to load fixtures during unit tests

2016-05-05 Thread Rich Rauenzahn
e way, Django 1.7 is no longer supported. Please make sure you can > reproduce the issue on Django master so we don't spend time debugging > issues that have since been fixed. > > On Wednesday, May 4, 2016 at 7:13:42 PM UTC-4, Rich Rauenzahn wrote: >> >> >> I'm in the

failure to load fixtures during unit tests

2016-05-04 Thread Rich Rauenzahn
I'm in the middle of trying to track down a problem with loading fixtures during unit tests -- I'm hesitant to call it a bug in Django 1.7, but the inconsistent behavior is really stumping me. Essentially I've made a fixture via manage dumpdata --indent=3 -e sessions -e admin -e

Fwd: Misleading 404 exception during unit tests.

2015-03-24 Thread Benjamin Scherrey
mbedded in it. >>> >>> Thanx to Rene Fleschenberg on irc for the doc link. >>> >>> >>> On Mon, Mar 23, 2015 at 8:42 PM, Benjamin Scherrey <prote...@gmail.com> >>> wrote: >>> >>>> Can someone explain the test condition on line

Re: Proposal: Write unit tests for JavaScript

2014-08-01 Thread Nick Sandford
approach? Some of the responses here are using a similar stack. On Mon, May 5, 2014 at 7:19 AM, Trey Hunner <t...@treyhunner.com> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I started a rough draft of a DEP for adding unit tests for Django's > JavaScript: http

Re: Proposal: Write unit tests for JavaScript

2014-05-05 Thread Trey Hunner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I started a rough draft of a DEP for adding unit tests for Django's JavaScript: https://github.com/django/deps/pull/4 I am suggesting that a native JavaScript test framework be used *without* attempting to use an adapter to run the tests under

Re: Proposal: Write unit tests for JavaScript

2014-04-24 Thread Trey Hunner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Kamil, I started another thread related to JS linting: https://groups.google.com/forum/#!topic/django-developers/GUgRMnnC0dM Here is a related pull request: https://github.com/django/django/pull/2577 I have not yet changed the code style of any

Re: Proposal: Write unit tests for JavaScript

2014-04-24 Thread Trey Hunner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for the information Jannis. I hadn't realized that project got to the point of a pull request. Personally I prefer running unit tests without LiveServerTestCase. It seems like LiveServerTestCase should be used for functional tests (using

Re: Proposal: Write unit tests for JavaScript

2014-04-22 Thread Kamil Gałuszka
Hi Trey, You may be interested in this: https://code.djangoproject.com/ticket/20436 I've started to work on this last year on DjangoCon Europe, I never manage to finish my work mostly because of my work on thesis and other stuff. Maybe I will finish this ticket this week and you start writing

Re: Proposal: Write unit tests for JavaScript

2014-04-19 Thread Jannis Leidel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Trey, all, I know we shortly talked about that at PyCon but I forgot to mention that a while ago we took a stab at that already. Sean Bleier was spear heading it and I helped out here and there:

Re: Proposal: Write unit tests for JavaScript

2014-04-18 Thread Marc Tamlyn
tests for any Django application. Several projects I have worked on has two completely distinct test suites one for JS and one for python. Being able to run both together must be better - and may also allow use of LiveServer like functionality within your JS (leaky) "unit" tests. Marc On 1

Re: Proposal: Write unit tests for JavaScript

2014-04-18 Thread Trey Hunner
> On 04/16/2014 07:20 PM, Russell Keith-Magee wrote: > > 2) Is there anything that can save us from the Node.js kudzu? :-) Yes. Removing JavaScript from Django. :-) JSHint requires Node.js and running automated JavaScript tests typically requires Node.js and PhantomJS. Node.js is pretty easy

Re: Proposal: Write unit tests for JavaScript

2014-04-17 Thread Carl Meyer
On 04/16/2014 07:20 PM, Russell Keith-Magee wrote: > On Thu, Apr 17, 2014 at 5:57 AM, Trey Hunner > wrote: > > I saw a previous discussion about JavaScript testing in Django but > it looks like there hasn't been any progress in a few

Re: Proposal: Write unit tests for JavaScript

2014-04-17 Thread Matthew Lauber
Regarding running javascript tests, could we consider something like rhino? Just an off the top of my head suggestion. Would avoid node.js, not sure if it's an improvement though. Matt Lauber On Wed, Apr 16, 2014 at 9:20 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > > On Thu,

Re: Proposal: Write unit tests for JavaScript

2014-04-16 Thread Russell Keith-Magee
On Thu, Apr 17, 2014 at 5:57 AM, Trey Hunner wrote: > I saw a previous discussion about JavaScript testing in Django but it > looks like there hasn't been any progress in a few years. > > Some of my thoughts on this issue: > > This would require choosing a JavaScript testing

Proposal: Write unit tests for JavaScript

2014-04-16 Thread Trey Hunner
I saw a previous discussion about JavaScript testing in Django but it looks like there hasn't been any progress in a few years. Some of my thoughts on this issue: This would require choosing a JavaScript testing framework. There are many good ones out there. A popular one should probably used

Re: Unit tests error out with WinError 10013 in my Windows 7 machine with Python 3.3.2

2013-10-30 Thread Ramiro Morales
If you update your git clone these Windows-specific extra errors and failures shouldn't be there anymore either. Please report back if that isn't the case. Ramiro Morales @ramiromorales On Oct 30, 2013 10:12 AM, "Antony J" wrote: > Sam, Marc, > > Thank you for your

Re: Unit tests error out with WinError 10013 in my Windows 7 machine with Python 3.3.2

2013-10-30 Thread Antony J
Sam, Marc, Thank you for your responses. Sorry I could not get back on this sooner. I ran the command “netstat -anob | findstr 8081” and found that the McAfee framework service was listening in port 8081. After killing the frameworkservice.exe, the errors went away. However, there still are 2

Re: Unit tests error out with WinError 10013 in my Windows 7 machine with Python 3.3.2

2013-10-24 Thread Marc Tamlyn
er developing a Django app, I am > trying to > > write my first patch for Django. > > > > I checked out Django from github: VERSION = (1, 7, 0, 'alpha', 0). > > > > When I run the unit tests with the command "python runtests.py", I get 6 > > err

Re: Unit tests error out with WinError 10013 in my Windows 7 machine with Python 3.3.2

2013-10-24 Thread Sam Lai
com> wrote: > Hi, > > Good morning. > > Your help is needed: > > I am relatively new to Django. After developing a Django app, I am trying to > write my first patch for Django. > > I checked out Django from github: VERSION = (1, 7, 0, 'alpha', 0). > > When I r

Unit tests error out with WinError 10013 in my Windows 7 machine with Python 3.3.2

2013-10-24 Thread Antony J
Hi, Good morning. Your help is needed: I am relatively new to Django. After developing a Django app, I am trying to write my first patch for Django. I checked out Django from github: VERSION = (1, 7, 0, 'alpha', 0). When I run the unit tests with the command "python runtests.py"

Re: RESTful web service unit tests

2011-05-12 Thread Jacob Kaplan-Moss
Hi Bruno -- I'm sorry, but we can't help you here. This mailing list is for discussion of developing Django itself, not user questions. The django-users group is the right forum for questions like yours, and I think you'll find an answer if you direct this question over there. Thanks! Jacob

RESTful web service unit tests

2011-05-12 Thread Bruno Ripa
Hi all, i am writing some tests to test a RESTful api i have written (Django 1.3, using piston, python 2.6.5). The url is basically: /api/products and you need to be logged to access it. We can use such api, via curl PUT query (the client code uses pycurl to access the ws). It works in

Re: Unit tests

2010-08-19 Thread Luke Plant
On Wed, 2010-08-18 at 14:24 -0700, Tom wrote: > I'm interested in writing a unit test suite that does not require all > the components of Django to be bootstrapped. > Correct me if I'm wrong, there are only integration tests bundled with > Django. There are lots of tests that would certainly

Re: Unit tests

2010-08-18 Thread Russell Keith-Magee
of services (such as email) to alternatives that don't have external effects. Regardless of whether you're running unit tests or integration tests, these are pretty much essential prerequisites for running a test of Django code. If you're talking about the overhead involved in using django.test.TestCase, th

Unit tests

2010-08-18 Thread Tom
I'm interested in writing a unit test suite that does not require all the components of Django to be bootstrapped. Correct me if I'm wrong, there are only integration tests bundled with Django. Would a unit testing suite be valuable to Django? If yes, I would contribute. Tom -- You received

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Martin Omander
Sean, That's great stuff; exactly what I was looking for. Thanks for the pointer! /Martin On Dec 9, 12:40 pm, Sean Brant wrote: > This might help you > outhttp://ericholscher.com/projects/django-test-utils/keep_database_runn > Or at least give you some pointers. > >

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Sean Brant
This might help you out http://ericholscher.com/projects/django-test-utils/keep_database_runner.html. Or at least give you some pointers. - Sean On Wed, Dec 9, 2009 at 2:16 PM, Martin Omander wrote: > Russ, > > The method you describe sounds like the preferred way.

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Martin Omander
Russ, The method you describe sounds like the preferred way. It's cleaner to add a new test runner module than to modify existing Django code. I really like it. But as you say, it's not obvious how to do this. I'd like to do a write-up of how this is done, for the common use case where you don't

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 7:22 PM, wrote: >> Django allows you to define a custom test runner. Copy >> django.tests.simple.run_tests() into your own code, removing the calls >> to create and destroy the test database. Then set TEST_RUNNER in your >> settings file to point at the

Re: Running unit tests when you can't create a new database

2009-12-09 Thread reg_gc
> Django allows you to define a custom test runner. Copy > django.tests.simple.run_tests() into your own code, removing the calls > to create and destroy the test database. Then set TEST_RUNNER in your > settings file to point at the new runner. Hello! I see many similar bugreports and wishes

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 8:53 AM, Martin Omander <martin.oman...@gmail.com> wrote: > Hi all, > > How about letting Django users run unit tests without creating a new > test database? > > To use Django's built-in unit test harness, you have to have database > creation pr

Re: Running unit tests when you can't create a new database

2009-12-08 Thread Martin Omander
when I test against another database than MySql. /Martin On Dec 8, 6:21 pm, rebus_ <r.dav...@gmail.com> wrote: > 2009/12/9 Martin Omander <martin.oman...@gmail.com>: > > > > > Hi all, > > > How about letting Django users run unit tests without creating a new &

Re: Running unit tests when you can't create a new database

2009-12-08 Thread rebus_
2009/12/9 Martin Omander <martin.oman...@gmail.com>: > Hi all, > > How about letting Django users run unit tests without creating a new > test database? > > To use Django's built-in unit test harness, you have to have database > creation privileges. Not all web hosts

Re: Proposal: Do not use global settings.py when running unit tests

2008-11-03 Thread Siddhi
On Nov 3, 6:30 pm, Carl Meyer <[EMAIL PROTECTED]> wrote: > On Nov 3, 3:24 am, Siddhi <[EMAIL PROTECTED]> wrote: > > > What is needed is a way for a test to specify its environment so that > > it is run in the same environment irrespective of the project > > environment specified in settings.py.

Re: Proposal: Do not use global settings.py when running unit tests

2008-11-03 Thread Carl Meyer
On Nov 3, 3:24 am, Siddhi <[EMAIL PROTECTED]> wrote: > What is needed is a way for a test to specify its environment so that > it is run in the same environment irrespective of the project > environment specified in settings.py. This doesn't fix the third-party/contrib apps problem, but "a way

Re: Proposal: Do not use global settings.py when running unit tests

2008-11-03 Thread Calvin Spealman
+1 On Mon, Nov 3, 2008 at 3:24 AM, Siddhi <[EMAIL PROTECTED]> wrote: > > So here is the situation: > > I have a middleware installed that looks at the HTTP_HOST header and > stores the domain and subdomain into the request object. Now when > running unit tests

Proposal: Do not use global settings.py when running unit tests

2008-11-03 Thread Siddhi
So here is the situation: I have a middleware installed that looks at the HTTP_HOST header and stores the domain and subdomain into the request object. Now when running unit tests, the tests fail because the HTTP_HOST header is not passed into the test Client object. Even if I modify my own

Re: Want to have unit tests in multiple files

2008-05-23 Thread Sebastian Noack
On Fri, 23 May 2008 13:32:45 -0500 "Gary Wilson Jr." <[EMAIL PROTECTED]> wrote: > In case you haven't figured this out already, it can be done by > importing your unit test classes from the test/*.py modules in > tests/__init__.py That is exactly what I have done at my work, just a few days

Re: Want to have unit tests in multiple files

2008-05-23 Thread Gary Wilson Jr.
Alex Koshelev wrote: > No. Not `tests.py`, but `tests` module - that can be a package of many > other modules/files In case you haven't figured this out already, it can be done by importing your unit test classes from the test/*.py modules in tests/__init__.py Gary

Re: Want to have unit tests in multiple files

2008-05-06 Thread Alex Koshelev
No. Not `tests.py`, but `tests` module - that can be a package of many other modules/files On May 7, 12:21 am, Steve <[EMAIL PROTECTED]> wrote: > Hi, we're just getting started using Django unit tests, and it looks > like the documentation says you can only have unit tests

Re: Want to have unit tests in multiple files

2008-05-06 Thread Honza Král
AIL PROTECTED]> wrote: > > Hi, we're just getting started using Django unit tests, and it looks > like the documentation says you can only have unit tests in two files: > models.py and tests.py. We would prefer to put our unit tests in many > different files, with, say, ea

Want to have unit tests in multiple files

2008-05-06 Thread Steve
Hi, we're just getting started using Django unit tests, and it looks like the documentation says you can only have unit tests in two files: models.py and tests.py. We would prefer to put our unit tests in many different files, with, say, each main-line .py file having a corresponding unit-test

Re: Unit tests with Postgres backend and transaction errors

2008-03-10 Thread kent
On Mar 10, 7:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Thereby making your point that you'd like to see all of core's > transactional handling changed slightly. May well be a valid point, but > please be clear that you're not actually talking about changing how the > test framework

Re: Unit tests with Postgres backend and transaction errors

2008-03-10 Thread Malcolm Tredinnick
On Mon, 2008-03-10 at 04:25 -0700, kent wrote: > On Mar 9, 4:44 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > If > > you want to test in-function error recovery, you're going to have to do > > the rollback yourself, just like in normal code. > > Why should normal code which does not

Re: Unit tests with Postgres backend and transaction errors

2008-03-10 Thread kent
On Mar 9, 4:44 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > If > you want to test in-function error recovery, you're going to have to do > the rollback yourself, just like in normal code. Why should normal code which does not use explicit transactions have to do the rollback? Why not

Re: Unit tests with Postgres backend and transaction errors

2008-03-09 Thread Malcolm Tredinnick
On Sun, 2008-03-09 at 05:42 -0700, kent wrote: > On Mar 9, 3:52 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> > wrote: > > That said, I'm not sure there is much we can do about it. It isn't as > > simple as wrapping the test case with a try/except block; if you are > > explictly testing error

Re: Unit tests with Postgres backend and transaction errors

2008-03-07 Thread Malcolm Tredinnick
On Fri, 2008-03-07 at 09:58 -0800, meppum wrote: > I've been playing with Django for a while now, learning the ropes and > such. I started building some unit tests using the django TestCase > classes, but recently I've hit a snag with using Postgres as the > backend to my tests

Re: : default settings for unit tests

2008-02-13 Thread Mike Scott
Further to this I'd like to point out that SQL lite is a very limited database in respect to the other offerings. Encouraging such a practice, in my opinion, is a really bad idea. Just my 2c. Mike On Feb 13, 2008 3:55 PM, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On Feb 13, 2008

Re: : default settings for unit tests

2008-02-12 Thread Russell Keith-Magee
On Feb 13, 2008 1:56 AM, David Cramer <[EMAIL PROTECTED]> wrote: > > Why don't they provide settings for MySQL, PostgreSQL, Oracle, MSSQL, > etc? If you think about what goes in a MySQL/PostgreSQL/Oracle settings file, the answer will be obvious. Yours, Russ Magee %-)

Re: [PATCH]: default settings for unit tests

2008-02-12 Thread Russell Keith-Magee
On Feb 12, 2008 10:47 PM, Waldemar Kornewald <[EMAIL PROTECTED]> wrote: > Hi, > when I tried to run Django's unit tests I faced a little problem: it > wanted me to create a settings file. Why don't you provide a fallback > test configuration with sqlite3 (if that exists

Re: : default settings for unit tests

2008-02-12 Thread David Cramer
Why don't they provide settings for MySQL, PostgreSQL, Oracle, MSSQL, etc? On Feb 12, 5:47 am, "Waldemar Kornewald" <[EMAIL PROTECTED]> wrote: > Hi, > when I tried to run Django's unit tests I faced a little problem: it > wanted me to create a settings file. Why don

[PATCH]: default settings for unit tests

2008-02-12 Thread Waldemar Kornewald
Hi, when I tried to run Django's unit tests I faced a little problem: it wanted me to create a settings file. Why don't you provide a fallback test configuration with sqlite3 (if that exists)? That would make testing patches a lot easier. My patch is attached. Regards, Waldemar Kornewald

Re: Problem in Django's unit tests?

2007-11-18 Thread Todd O'Bryan
playing with the Django tests a bit and noticed something > > odd. Here's what the docs say: > > > > Yes, the unit tests need a settings module, but only for database > > connection info, with the DATABASE_ENGINE setting. You will also need > > a ROOT_URLCONF setting

Re: Problem in Django's unit tests?

2007-11-18 Thread Malcolm Tredinnick
On Sun, 2007-11-18 at 22:54 -0500, Todd O'Bryan wrote: > I've been playing with the Django tests a bit and noticed something > odd. Here's what the docs say: > > Yes, the unit tests need a settings module, but only for database > connection info, with the DATABASE_ENGINE setting

Problem in Django's unit tests?

2007-11-18 Thread Todd O'Bryan
I've been playing with the Django tests a bit and noticed something odd. Here's what the docs say: Yes, the unit tests need a settings module, but only for database connection info, with the DATABASE_ENGINE setting. You will also need a ROOT_URLCONF setting (its value is ignored; it just needs

Re: Django unit tests for pre/post_save, pre/post_delete signals

2007-08-21 Thread George Vilches
Russell Keith-Magee wrote: > On 8/21/07, George Vilches <[EMAIL PROTECTED]> wrote: >> All, >> >> I've looked everywhere in the Django unit tests and can't find anywhere >> that's testing these four signals: > ... >> Thoughts? > > Only one thoug

Re: Django unit tests for pre/post_save, pre/post_delete signals

2007-08-21 Thread Russell Keith-Magee
On 8/21/07, George Vilches <[EMAIL PROTECTED]> wrote: > > All, > > I've looked everywhere in the Django unit tests and can't find anywhere > that's testing these four signals: ... > Thoughts? Only one thought - put this in a ticket so it doesn't get lost or forgo

Django unit tests for pre/post_save, pre/post_delete signals

2007-08-21 Thread George Vilches
All, I've looked everywhere in the Django unit tests and can't find anywhere that's testing these four signals: pre_save post_save pre_delete post_delete I found the dispatcher tests, which cover all the generic bits, but nothing specifically for these model signals. On the assumption

Re: running the unit tests in the schema evolution branch

2006-11-10 Thread Victor Ng
Thanks for the heads up on the symlinks. My problem was with stale pyc files created by symlinked .py files. Blech. What version of sqlite and pysqlite were you testing on? I can get SQL output from mysql and psycopg1 now, but nothing out of sqlite3. vic > > The emitted output on my machine

Re: running the unit tests in the schema evolution branch

2006-11-10 Thread Derek Anderson
Victor Ng wrote: > The tests don't look like they're integrated with runtests.py at all. no, they're standalone. > 3) Run reset_all_to_pre (note that this doesn't have a shebang at the top) > 5) Run reset_all_to_post (note that this script also doesn't have a > shebang at the top) we're all

Re: running the unit tests in the schema evolution branch

2006-11-08 Thread Victor Ng
Nevermind. Tests are starting to run for me, but they only work on mysql. I get failures on sqlite3 and postgresql_psycopg2. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to

running the unit tests in the schema evolution branch

2006-11-08 Thread Victor Ng
Hi all, Has anyone had any success in running the tests in the schema evolution branch? The tests don't look like they're integrated with runtests.py at all. As far as I can tell, you have to do the following to get the test suite to run: 1) cd schema-evolution/tests/evolvedbtests 2) the

Re: Unit Tests for Filters

2006-06-05 Thread Luke Plant
John Sutherland wrote: > Is there some registration process I'm missing for the > filters? Yep. See: http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters and the bottom of:

Unit Tests for Filters

2006-06-04 Thread John Sutherland
Hi all, I'm writing unit tests for a couple of template filters I 'enhanced', but am having a little trouble getting them to work. My patch is ticket number #2053 (http://code.djangoproject.com/ticket/ 2053) -- I've written the unit tests for timesince, and they work fine