Django testing with existing data

2011-08-23 Thread Carlos Brum
Hello guys, I'm new in Django testing whith django test facilities. I've read "https://docs.djangoproject.com/en/1.3/topics/testing/; but couldn't find what i'm looking for. I'm trying to begin TDD development but wanna use my old data. I don't wanna have to build up all my database aga

Re: Best practice when testing form values in a template?

2011-08-05 Thread Joshua Russo
Ok, I apologize. Here is a fuller representation of what I'm doing. I had a hard time figuring out how much was enough versus too much. This is simplified, but I think it represents what I'm trying to do. For instance, don't pay too much attention to the save logic in the view, I haven't

Re: Best practice when testing form values in a template?

2011-08-03 Thread Shawn Milochik
On 08/03/2011 10:46 PM, Joshua Russo wrote: Really? Nothing? Do you need more information? From the lack of response I feel like I'm completely off the mark and nobody wants to tell me. -- 1: https://code.djangoproject.com/wiki/UsingTheMailingList If you're not getting help then it's almost

Re: Best practice when testing form values in a template?

2011-08-03 Thread Joshua Russo
Really? Nothing? Do you need more information? From the lack of response I feel like I'm completely off the mark and nobody wants to tell me. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Best practice when testing form values in a template?

2011-08-03 Thread Joshua Russo
Or am I not using these concepts as intended? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/UvoTGqPzDBoJ. To post to this group, send email to

Best practice when testing form values in a template?

2011-08-02 Thread Joshua Russo
Ok, so I've created a fairly simple form: class OrganizationItemForm(AuditModelForm): selected = forms.BooleanField() extraRequired = forms.BooleanField(widget=forms.HiddenInput) multiLineInfo = forms.BooleanField(widget=forms.HiddenInput) def __init__(self, *args,

Re: Recommendations for load testing/profiling a django site server?

2011-07-22 Thread Malcolm Box
On 22 July 2011 13:52, Jacob Kaplan-Moss wrote: > On Thu, Jul 21, 2011 at 5:03 PM, br wrote: > > I am running on a Linode 768 VPS and may have some stuff going live > > before too long. I'm wondering what the best way to guage whether I > > have enough

Re: Recommendations for load testing/profiling a django site server?

2011-07-22 Thread Jacob Kaplan-Moss
with an ugly Java GUI), but can test multiple protocols, distribute load testing across multiple machines, and has excellent reporting tools. * Tsung (http://tsung.erlang-projects.org/) - can be used a lot like Siege, but Tsung's real strength is that it's easy to extend (in Erlang, for better or w

Recommendations for load testing/profiling a django site server?

2011-07-21 Thread br
I am running on a Linode 768 VPS and may have some stuff going live before too long. I'm wondering what the best way to guage whether I have enough bandwidth/CPU/memory to handle a significant amount of traffic is and/or to get an idea of the types of loads the site can handle before i need to

Re: Unit-Testing Dilemma

2011-06-22 Thread Nan
> Use Mock and assert_called_with: > http://www.voidspace.org.uk/python/mock/mock.html#mock.Mock.assert_ca... > In this case you'd set theAPI.call as your mock and check that under > different conditions it is called correctly. Oh, perfect -- thank you, that will help a lot! > You don't need

Re: csrf protection and testing with tsung

2011-06-22 Thread Malcolm Box
On 22 June 2011 09:52, Ivan Uemlianin wrote: > > Thanks very much for your help!  You were exactly right.  The > following config works (simplified for exposition). Glad that helped, and thank you for coming back with the working settings for anyone else who runs into the

Re: csrf protection and testing with tsung

2011-06-22 Thread Ivan Uemlianin
Dear Malcom Thanks very much for your help! You were exactly right. The following config works (simplified for exposition). Best wishes Ivan On Jun 21, 5:54 pm, Malcolm Box wrote: > On 21 June 2011 16:48, Ivan Uemlianin

Re: Unit-Testing Dilemma

2011-06-21 Thread Andrew Brookins
You don't need mocks or dependency injection in this case. Just separate the message construction code, so you can test it in isolation: # myapp.views from django.http import HttpResponse from myapp.models import CurrentState from myapp.exceptions import ApiFailureException from third_party.api

Re: Unit-Testing Dilemma

2011-06-21 Thread Andy McKay
On 2011-06-20, at 12:52 PM, Nan wrote: > I'm not testing the third-party service. I need to test *what I send > to them*. Use Mock and assert_called_with: http://www.voidspace.org.uk/python/mock/mock.html#mock.Mock.assert_called_with In this case you'd set theAPI.call as your mock and

Re: csrf protection and testing with tsung

2011-06-21 Thread Ivan Uemlianin
Dear Malcolm Thanks, this is a good clue. I'll try it out tomorrow and report back. Best wishes Ivan On 21/06/11 17:54, Malcolm Box wrote: On 21 June 2011 16:48, Ivan Uemlianin wrote: With tsung you record a site visit (called a session) --- log in, view various

Re: csrf protection and testing with tsung

2011-06-21 Thread Malcolm Box
On 21 June 2011 16:48, Ivan Uemlianin wrote: > With tsung you record a site visit (called a session) --- log in, view > various pages, do a few things, log out --- and tsung will then hit > the site with lots of randomised versions of this session. > > Many of the views

Re: Unit-Testing Dilemma

2011-06-21 Thread Nan
e supporting functions that I need to test, but they currently don't return anything more informative than the view does (i.e. blank HttpResponse) > If this is all for a refactoring, then you're probably on the right track > there -- instrument the existing object for testing, rather than > restruc

csrf protection and testing with tsung

2011-06-21 Thread Ivan Uemlianin
Dear All I have a live(ish) django website which I'm testing with tsung. With tsung you record a site visit (called a session) --- log in, view various pages, do a few things, log out --- and tsung will then hit the site with lots of randomised versions of this session. Many of the views

Re: Unit-Testing Dilemma

2011-06-21 Thread Ian Clelland
having it call the actual 3rd-party API as imported > at > > the top of the file. > > I'd be a little confused as to how to factor that out. I mean, in the > actual app that call is refactored behind a function that wraps the > third-party API, and I could theoretically monkey-p

Re: Unit-Testing Dilemma

2011-06-21 Thread Nan
ed as to how to factor that out. I mean, in the actual app that call is refactored behind a function that wraps the third-party API, and I could theoretically monkey-patch something over that function call for unit testing. But the view still has to return an HttpResponse, and a blank one. >

Re: Unit-Testing Dilemma

2011-06-20 Thread Ian Clelland
On Mon, Jun 20, 2011 at 4:25 PM, Nan <ringe...@gmail.com> wrote: > > Hm, I'm not worried about receiving a valid response from the third- > party API, just about testing the value of the "msg" parameter that's > passed into it. I need to test the msg parameter because

Re: Unit-Testing Dilemma

2011-06-20 Thread Nan
Hm, I'm not worried about receiving a valid response from the third- party API, just about testing the value of the "msg" parameter that's passed into it. I need to test the msg parameter because it is in turn essentially a proxy for which state was reached in my_view. my_view i

Re: Unit-Testing Dilemma

2011-06-20 Thread DrBloodmoney
On Mon, Jun 20, 2011 at 3:52 PM, Nan <ringe...@gmail.com> wrote: > I'm not testing the third-party service.  I need to test *what I send > to them*.  I.e. that the output of my_view is correct.  The trouble is > that neither my_view nor the API call actually returns the outpu

Re: Unit-Testing Dilemma

2011-06-20 Thread Nan
I'm not testing the third-party service. I need to test *what I send to them*. I.e. that the output of my_view is correct. The trouble is that neither my_view nor the API call actually returns the output that I need to check. Does that make sense? On Jun 20, 1:59 pm, Daniel Roseman <

Re: Unit-Testing Dilemma

2011-06-20 Thread Daniel Roseman
On Monday, June 20, 2011 6:07:59 PM UTC+1, Nan wrote: > > In most situations, my app, upon receiving an HTTP request, sends data > to a third-party API, and returns an empty HttpResponse. I need to > test that the correct data is sent to the third-party API based on > internal application

Unit-Testing Dilemma

2011-06-20 Thread Nan
In most situations, my app, upon receiving an HTTP request, sends data to a third-party API, and returns an empty HttpResponse. I need to test that the correct data is sent to the third-party API based on internal application state. I'm perplexed as to how to intercept this data in a unit test.

Re: Testing with managed tables

2011-05-24 Thread Karen Tracey
On Mon, May 23, 2011 at 12:47 PM, Vincent <discol...@gmail.com> wrote: > Whenever I try to run unit tests with my managed tables, Django > insists on re creating the test database, and then the tables do not > get created for testing. in providing initial data, there seems t

Testing with managed tables

2011-05-23 Thread Vincent
Whenever I try to run unit tests with my managed tables, Django insists on re creating the test database, and then the tables do not get created for testing. in providing initial data, there seems to be no place to create a table. How should I do unit testing on unmanaged tables? -- You received

Re: unit testing and file location

2011-05-11 Thread Calvin Spealman
You can run your tests with their own --settings parameter with the specific variations you want to test under. On May 10, 2011 5:21 PM, "Brian Craft" wrote: I would like unit tests that do file manipulations to run with a different storage "location", so they're not

unit testing and file location

2011-05-10 Thread Brian Craft
I would like unit tests that do file manipulations to run with a different storage "location", so they're not manipulating real app files. Is there a good way to do this? Is there a way to override model field initializers, so I can instance a model, passing in the 'storage' parameter for an

testing a model that uses stored procedures

2011-05-07 Thread Viktor Kojouharov
Hello, I have a model that uses a stored procedure + a column outside of django's control for specialized selects. My problem is that I don't see a good way of testing my related python code for that model. Since I need to execute some SQL code at the beginning of each test, right after

Re: Testing if a receiver is connected to a signal

2011-05-05 Thread Vinicius Mendes
Boa. Funciona para resolver esse problema. Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com On Thu, May 5, 2011 at 1:33 PM, Bernardo Fontes wrote: > Hello everybody, > > I resolved this problem by looking at Djangos Signal's code and > understanding

Re: Testing if a receiver is connected to a signal

2011-05-05 Thread Bernardo Fontes
Hello everybody, I resolved this problem by looking at Djangos Signal's code and understanding its structure. The signal has an attribute called receivers which has stored references to its receivers function that were connect to it. When the send function is called, the signal just call this

Re: Question about "Django 1.1 Testing and Debugging" Book for Karen

2011-04-29 Thread Margie Roginski
and created a django product to bootstrap myself on web app development there. The one thing I feel that I could have done better on my recent project was my testing. I used selenium extensively (and that did work well for me), but I did not test from inside the core django framework much, so I am looking

Re: Question about "Django 1.1 Testing and Debugging" Book for Karen

2011-04-29 Thread Karen Tracey
ct that there seem to be > some differences between django 1.1 and django 1.2 in terms of > testing. At a minimum, it seems that tests.py doesn't get even get > created by startapp anymore! > > No, the sample tests.py file is still created in by startapp in Django 1.2, 1.3, and current trun

Question about "Django 1.1 Testing and Debugging" Book for Karen

2011-04-28 Thread Margie Roginski
Hi Karen, I have a bit of time on my hands and was going to run through your book to cement my understanding of the best way to test. I started out and was immediately confronted with the fact that there seem to be some differences between django 1.1 and django 1.2 in terms of testing

Re: Testing if a receiver is connected to a signal

2011-04-19 Thread Bernardo Fontes
Hi, I'm having this problem too. Does anyone knows a good strategy to handle this problem? On 21 fev, 17:50, Vinicius Mendes wrote: > Hi, > > I want to test if a receiver function is connected to a signal in django, > but I don't want other receivers from other apps to be

Re: testing views problem

2011-04-15 Thread Daniel Gerzo
their content. Unfrotunately, running this code from the shell doesn't work as I was expecting (am quite new to testing and all this stuff, so I wanted to play around first in the shell to know what to expect.) Carl Meyer noted that he has a patch to fix this, but is not quite ready yet. -- You

Re: testing views problem

2011-04-14 Thread Daniel Gerzo
On 14.4.2011 18:21, Shawn Milochik wrote: If the code sample you pasted is accurate, then you have an extra space between 'activate' and the next forward-slash. I doesn't really matter what kind of URL I pass to get() method (I am actually using reverse mostly), the thing is that I am getting

Re: testing views problem

2011-04-14 Thread Shawn Milochik
If the code sample you pasted is accurate, then you have an extra space between 'activate' and the next forward-slash. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To

testing views problem

2011-04-14 Thread Daniel Gerzo
Hello all, I am beginning to write view tests and I was following what we have in docs at http://docs.djangoproject.com/en/dev/topics/testing/ and also this nice article at http://toastdriven.com/blog/2011/apr/10/guide-to-testing-in-django/. I have a strange problem with the below code

innodb ibdata1 file grows irreversibly from testing

2011-02-22 Thread Cody Django
from what I understand, the ibdata1 file doesn't recover space from dropped tables. Since django testing creates a test database and then drops it, repeatedly, does this contribute to the ibdata1 file size? Thanks Cody -- You received this message because you are subscribed to the Google

Re: Unit Testing: temporarily altering django settings

2011-02-21 Thread Phlip
On Feb 21, 12:47 pm, Cody Django wrote: > Thanks -- I didn't know about mock objects, and this is good to know. > But this doesn't feel like this is the solution I'm looking for.  It's > a large project, and your proposal would require extensive patching. Does your project

Re: Unit Testing: temporarily altering django settings

2011-02-21 Thread Mikhail Korobov
Why doesn't setattr work? Just make sure you're setting the proper option because apps often cache options at e.g. their 'config.py' file in order to provide default values: # captha_app/config.py from django.conf import settings CAPTCHA = getattr(settings, 'CAPTCHA', True) So you'll have to

Testing if a receiver is connected to a signal

2011-02-21 Thread Vinicius Mendes
Hi, I want to test if a receiver function is connected to a signal in django, but I don't want other receivers from other apps to be called when my test runs. I thought of verifying if my callback function is in the receivers list of the signal, but this list stores the receivers in a strange

Re: Unit Testing: temporarily altering django settings

2011-02-21 Thread Cody Django
Thanks -- I didn't know about mock objects, and this is good to know. But this doesn't feel like this is the solution I'm looking for. It's a large project, and your proposal would require extensive patching. Is the solution to create a new testrunner that sets a different environment (with

Re: testing foo_set existence for each object in a queryset

2011-02-20 Thread Dan
> creating the filtering you wrote in your message on the queryset level > (without going to the db for each object), right? > > Hard to say without actually seeing your code and testing, but would > this be the same? > > MyModel.objects.filter(foo_set__endtime__gt == > dateti

Re: testing foo_set existence for each object in a queryset

2011-02-20 Thread Dan
Thanks Shawn That's helpful. I was actually looking at the manager documentation today thinking perhaps that was what I needed - but couldn't quite wrap my head around it. But knowing that it indeed is the way to go will no doubt provide the motivation I need. (I have problems learning

Re: testing foo_set existence for each object in a queryset

2011-02-19 Thread Lior Sion
Dan, If I understand your question correctly, you are struggling with creating the filtering you wrote in your message on the queryset level (without going to the db for each object), right? Hard to say without actually seeing your code and testing, but would this be the same

Re: testing foo_set existence for each object in a queryset

2011-02-19 Thread Shawn Milochik
Not only is it not a stupid question, but it's one of the best possible types of questions. Any time someone comes in and makes it obvious that they've thought about their problem and made an attempt to solve it themselves, they get my respect. The easiest answer to your question is to make a

testing foo_set existence for each object in a queryset

2011-02-19 Thread Dan
Hi, Long time lurker - first time poster - hopefully future answerer... Basically what I want to do can be done with: result = [w for w in MyModel.objects.all() if w.foo_set.filter(endtime__gt = datetime.datetime.now()).exists()] Is there anyway to do this using the queryset api? Hopefully

Re: Unit Testing: temporarily altering django settings

2011-02-17 Thread Phlip
On Feb 17, 12:03 pm, Cody Django wrote: > For example, I have a captcha that is used in parts of a site that > affects form logic. > The django settings has a variable CAPTCHA = True, which acts as a > switch. > > I'd like to change this setting in the setup for each

Unit Testing: temporarily altering django settings

2011-02-17 Thread Cody Django
For example, I have a captcha that is used in parts of a site that affects form logic. The django settings has a variable CAPTCHA = True, which acts as a switch. I'd like to change this setting in the setup for each TestCase. The regular unittests tests (in which we are assuming the captcha is

Re: testing: running something after the fixtures have been loaded

2011-02-10 Thread Karen Tracey
On Tue, Feb 8, 2011 at 4:05 PM, Bram de Jong wrote: > as far as I read it the django unit tests run setUp before the > fixtures are loaded... > is that correct? > No, where did you read that? Karen -- http://tracey.org/kmt/ -- You received this message because you are

testing: running something after the fixtures have been loaded

2011-02-08 Thread Bram de Jong
Hi, we want to write some testing code, but our site uses Solr for indexing. The test cases we are running are testing -among other things- the searching. problem is: we need to run some additional code to index the stuf the fixtures just inserted into the DB. as far as I read it the django

Testing in a project with multiple databases

2011-02-07 Thread Stathis
a failure. - I am looking for a way to create the structure of the test legacy database before testing. I want to do this by raw sql as the legacy databased is not managed by models. Is there any way to do that? Thank you. -- You received this message because you are subscribed to the Google Groups

Re: automated testing: how to generate human-verifiable views?

2011-01-25 Thread Simone Dalla
2011/1/4 Jennifer Bell <jenniferlia...@yahoo.ca> > Hi, > > I'm trying to figure out the best way of doing something I'd like > to partially automate staging testing by generating a sequence of > human verifiable views, with the goal of making sure my app views/css/ >

Re: automated testing: how to generate human-verifiable views?

2011-01-25 Thread Tom Evans
On Thu, Jan 6, 2011 at 11:07 PM, Jennifer Bell wrote: > Is this a really weird thing to want to do?  You can TDD almost > everything else in django through TestClient except for the end result > of how stuff looks. > > Jennifer > Not that weird:

Re: Mongo - testing

2011-01-22 Thread Andrew Marder
com> wrote: > On 20 January 2011 22:26, Andrew Marder <andrew.ei.mar...@gmail.com> wrote: > > > Has anyone had any luck setting up testing databases with mongo? Right > > now I'm using pymongo in a single app, and I thought it would be cool > > if in that app I c

Re: Mongo - testing

2011-01-21 Thread Konrad Delong
On 20 January 2011 22:26, Andrew Marder <andrew.ei.mar...@gmail.com> wrote: > Has anyone had any luck setting up testing databases with mongo? Right > now I'm using pymongo in a single app, and I thought it would be cool > if in that app I could see if my code was being tested and i

Re: Mongo - testing

2011-01-20 Thread Javier Guerra Giraldez
On Thu, Jan 20, 2011 at 4:26 PM, Andrew Marder <andrew.ei.mar...@gmail.com> wrote: > Problem is there doesn't seem > to be an environment variable in Django that will tell me whether my > code is being tested. that defeats the purpose of testing, doesn't it? even more in your

Mongo - testing

2011-01-20 Thread Andrew Marder
Has anyone had any luck setting up testing databases with mongo? Right now I'm using pymongo in a single app, and I thought it would be cool if in that app I could see if my code was being tested and in that case I could use a different database. Problem is there doesn't seem to be an environment

Re: automated testing: how to generate human-verifiable views?

2011-01-06 Thread Jennifer Bell
Sorry if I confused people... I'm still looking for some feedback. Really, I guess I just want to streamline CSS/layout/language/browser testing so problems that commonly occur aren't discovered on the final round of staging testing. I imagine a test series like: [ { series_name

Re: automated testing: how to generate human-verifiable views?

2011-01-04 Thread Jennifer Bell
OK, to elaborate: I have a open source project with consistent pain points around css and browser testing. Example concrete issues for this project are a) multi-language support, as varying text length will often throw off the aesthetics of the layout, and b) recently, a mysterious failure

Re: automated testing: how to generate human-verifiable views?

2011-01-04 Thread Nick Stinemates
think. Nick On Tuesday, January 4, 2011, Jennifer Bell <jenniferlia...@yahoo.ca> wrote: > Hi, > > I'm trying to figure out the best way of doing something I'd like > to partially automate staging testing by generating a sequence of > human verifiable views, with the goal

automated testing: how to generate human-verifiable views?

2011-01-04 Thread Jennifer Bell
Hi, I'm trying to figure out the best way of doing something I'd like to partially automate staging testing by generating a sequence of human verifiable views, with the goal of making sure my app views/css/ 3rd-party javascript etc. are drawing the way they ought to in more complicated

Re: Django testing not loading certain fixtures

2010-12-23 Thread churris
Are you loading you fixtures within your test class? eg. fixtures = ['my_fixture.xml'] Make sure that also you have included in yoour settings file the following: FIXTURE_DIRS = ( os.path.join(PROJECT_PATH, '../testing/fixtures') of course with the path where you fixture is. Hope this helps

Re: Django testing not loading certain fixtures

2010-12-23 Thread caroline
never mind...error on my side On Dec 23, 1:52 pm, caroline wrote: > I'm experiencing some problems when loading fixtures for Django > unittests. > > If I create a fixture with manage.py dumpdata, then loading of the > fixture works (except for the fact that there is an sql

Django testing not loading certain fixtures

2010-12-23 Thread caroline
I'm experiencing some problems when loading fixtures for Django unittests. If I create a fixture with manage.py dumpdata, then loading of the fixture works (except for the fact that there is an sql error, as i am using mysql innodb and django dumps some records before others with foreign key

Testing an app: adding an optional test model

2010-12-01 Thread Torsten Bronger
Hallöchen! In order to test my app, I need to add a model class just for testing. While it doesn't do much harm if it's always there because its DB table would remain empty, I'd like to add it only for the test runner. (Background: My app is extended by other apps. But for testing, I must

Re: testing django applications

2010-11-18 Thread roberto
What if you add a __init__.py inside AAA directory and in your abc/ tests.py you include "from projectXXX.AAA.xyz import class_to_test" plus all the test code you want for testing it ? Good luck! Roberto On Nov 18, 12:05 pm, girish shabadimath <girishmss.1...@gmail.com> wrote:

Re: testing django applications

2010-11-18 Thread girish shabadimath
..@gmail.com> > wrote: > > Thanks for the reply, > > but according to the django documentationhttp:// > docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests > > < > http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests > >test > >

Re: testing django applications

2010-11-18 Thread xvga
oproject.com/en/1.2/topics/testing/#writing-unit-tests >  <http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests>test > runner looks for tests only in models.py or tests.py of a specific > application,,but my xyz.py is not present in any of the application. > >

Re: testing django applications

2010-11-18 Thread girish shabadimath
Thanks for the reply, but according to the django documentation http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests <http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests>test runner looks for tests only in models.py or tests.py of a specific appli

Re: testing django applications

2010-11-18 Thread xvga
> > i need to write tests for xyz.py,  as i understood by > readinghttp://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests >  <http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests> > ,tests > need to be present in any one application directory (here its

testing django applications

2010-11-18 Thread girish shabadimath
settings.py urls.py i need to write tests for xyz.py, as i understood by reading http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests <http://docs.djangoproject.com/en/1.2/topics/testing/#writing-unit-tests> ,tests need to be present in any one application directory (he

Re: Are multiple databases supported by the testing framework?

2010-11-14 Thread Russell Keith-Magee
On Mon, Nov 15, 2010 at 6:16 AM, churris <churri...@hotmail.com> wrote: > Hi Ramiro, > > I've tried that, but those notes are just to flush the second db, but > in this case, the issue is that the database is not even getting > created at all. Multi-db is supported under test

Re: Are multiple databases supported by the testing framework?

2010-11-14 Thread churris
ning the application works fine, syncdb > > works fine, is just the testing (unit testing) that I'm having > > problems.  It appears to me that the second database is never created, > > and even if I create that manually as (test_mydbname)  it keeps > > failing. > > > Is th

Re: Are multiple databases supported by the testing framework?

2010-11-14 Thread Ramiro Morales
cond > database started to fail. Running the application works fine, syncdb > works fine, is just the testing (unit testing) that I'm having > problems.  It appears to me that the second database is never created, > and even if I create that manually as (test_mydbname)  it keeps > failin

Are multiple databases supported by the testing framework?

2010-11-14 Thread churris
the testing (unit testing) that I'm having problems. It appears to me that the second database is never created, and even if I create that manually as (test_mydbname) it keeps failing. Is this supported? thanks -- You received this message because you are subscribed to the Google Groups "D

Re: Unit test failing when testing post of a comment

2010-11-14 Thread Phil Gyford
Answering myself, in case this is useful to anyone in the future... I eventually discovered the problem lay in the method which checked submitted comments for spam (a method along these lines: http://sciyoshi.com/blog/2008/aug/27/using-akismet-djangos-new-comments-framework/ ). It expected the

Unit test failing when testing post of a comment

2010-11-11 Thread Phil Gyford
Hi, I have a unit test that tests that a comment can be posted on an entry in a Django blog. Posting a comment myself in the browser works fine, but the test always fails with this error: "TemplateSyntaxError: Caught VariableDoesNotExist while rendering: Failed lookup for key [request] in

Re: BrightonPy event: The Why and How of Automated Testing with Python and Django

2010-11-04 Thread Jim Purbrick
The video and slides for this talk are now online here: http://jimpurbrick.com/2010/11/04/why-and-how-automated-testing-python-and-django/ Cheers, Jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Local testing setup with Python 2.7 OS X installer, mod_wsgi and Apache?

2010-10-31 Thread Dave E
/cacddadc0c3c8e93/c92475afc0cc31eb?q= ). For a local mod_wsgi/Django/Apache testing environment with the minimum of work (in this case using the OS X Apache and an OS X Python 2.7 installer), I'd like to hear from anyone with this setup on OS X 10.5, before I ditch my Python 2.6, rebuild mod_wsgi

Re: dump sqlite to file when testing

2010-10-22 Thread Phlip
objects back to nothing, providing test isolation, but at least the > > file itself would stick around? Or is :memory: somehow defaulted in, > > there? > > As I said in my last email, the relevant setting is TEST_NAME. NAME is > your normal database name. TEST_NAME is the name of th

Re: dump sqlite to file when testing

2010-10-21 Thread Russell Keith-Magee
y last email, the relevant setting is TEST_NAME. NAME is your normal database name. TEST_NAME is the name of the database during testing. Yes, it defaults to ':memory:' for SQLite. And yes, the test database will be rolled back (if you're using a django.test.TestCase. However, if you're not using a django

Re: dump sqlite to file when testing

2010-10-21 Thread Phlip
I just tried it: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # TODO restore'NAME': ':memory:', 'NAME': '/home/phlip/fun.db', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', } } Yes that's in my

Re: dump sqlite to file when testing

2010-10-21 Thread Miguel Araujo
Thanks Russ, I couldn't find it in the documentation, IMHO I think it's a little bit hidden. Best regards, Miguel Araujo 2010/10/21 Russell Keith-Magee > On Wed, Oct 20, 2010 at 10:33 PM, Miguel Araujo > wrote: > > Hi everyone, > > Is there any

Re: dump sqlite to file when testing

2010-10-20 Thread Russell Keith-Magee
On Wed, Oct 20, 2010 at 10:33 PM, Miguel Araujo wrote: > Hi everyone, > Is there any way to force sqlite3 to use a file instead of RAM when running > tests? I would like to access the DB somehow to check some fields. This is > the only DB engine I have in this machine. Yes

dump sqlite to file when testing

2010-10-20 Thread Miguel Araujo
Hi everyone, Is there any way to force sqlite3 to use a file instead of RAM when running tests? I would like to access the DB somehow to check some fields. This is the only DB engine I have in this machine. Thanks, Best regards Miguel Araujo -- You received this message because you are

BrightonPy event: The Why and How of Automated Testing with Python and Django

2010-10-20 Thread Jamie Matthews
Hi all, I thought our next BrightonPy meeting might be of interest to this list: The Why and How of Automated Testing with Python and Django Jim Purbrick, Tuesday October 26, 2010, 19:30 at The Skiff http://brightonpy.org/meetings/2010-10-26/ Why do we write tests? How do we write them? What

Re: HTTP load testing tools?

2010-10-19 Thread Paul Winkler
On Oct 13, 10:27 am, Paul Winkler wrote: > On Oct 13, 4:17 am, Chris Withers wrote: > > > Hey all, > > > I hope this is still on topic, but what tool sets do people around here > > use for doingloadtestingof Django projects? > > Same stuff as for any web

Re: HTTP load testing tools?

2010-10-13 Thread Chris Withers
On 13/10/2010 09:17, Chris Withers wrote: I hope this is still on topic, but what tool sets do people around here use for doing load testing of Django projects? Thanks for the answers... ...now to ask the question in a different way again ;-) Anyone recommend any load testing services

Re: HTTP load testing tools?

2010-10-13 Thread Paul Winkler
On Oct 13, 4:17 am, Chris Withers <ch...@simplistix.co.uk> wrote: > Hey all, > > I hope this is still on topic, but what tool sets do people around here > use for doing load testing of Django projects? Same stuff as for any web project. Last time I needed something more than a

Re: HTTP load testing tools?

2010-10-13 Thread Brian Bouterse
.uk>wrote: > Hey all, > > I hope this is still on topic, but what tool sets do people around here use > for doing load testing of Django projects? > > cheers, > > Chris > > -- > Simplistix - Content Management, Batch Processing & Python Consulting >

Re: HTTP load testing tools?

2010-10-13 Thread Jonathan Barratt
On 13 ?.?. 2010, at 15:17, Chris Withers wrote: > Hey all, > > I hope this is still on topic, but what tool sets do people around here use > for doing load testing of Django projects? I use httperf generally, haven't found a need to find something different for Django - http://ww

HTTP load testing tools?

2010-10-13 Thread Chris Withers
Hey all, I hope this is still on topic, but what tool sets do people around here use for doing load testing of Django projects? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- You received this mes

Re: Testing formset validation

2010-10-08 Thread ses1984
I should also add that neither the formset nor the form report .errors or .non_form_errors() at all. On Oct 8, 6:15 pm, ses1984 wrote: > I have a pretty simple form, defined below, that I am setting > according to some initial data, and no matter what I try, I can't seem > to

Testing formset validation

2010-10-08 Thread ses1984
I have a pretty simple form, defined below, that I am setting according to some initial data, and no matter what I try, I can't seem to get it to validate in a test. I have created some test data, which is an array with one dictionary element, where the dictionary corresponds to the form. If I

Re: Confused about testing a page protected with @login_required

2010-10-06 Thread Brandon Taylor
Apparently, this is a cookie related issue: http://stackoverflow.com/questions/2705235/django-test-failing-on-a-view-with-login-required I'm using Django 1.1.1 for use with Django-CMS and Python 2.6.5, so the problem with cookies as described by the Stack Overflow article explains why my test

<    1   2   3   4   5   6   7   8   9   10   >