testing with different settings

2009-09-23 Thread skunkwerk
Hi, I've been using the built-in django test suite, but need a way to somehow specify a different settings file or a configuration variable from the settings file, when the tests are run. Sort of similar to how django automatically changes the DATABASE_NAME setting - how does it actually do t

Re: Django testing applications: using fixtures

2009-09-07 Thread Oleg Oltar
uot;build/bdist.macosx-10.3-i386/egg/MySQLdb/cursors.py", line 166, in execute self.errorhandler(self, exc, value) File "build/bdist.macosx-10.3-i386/egg/MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue IntegrityError: (1062, "Duplicate

Re: Django testing applications: using fixtures

2009-09-07 Thread V
21 pm, Oleg Oltar wrote: > Django testing application: using fixtures > > Hi ! > > I came across strange problem while trying to use mixtures in my unittests > For example, I created a fixture from the database: > > silver:jin oleg$ python manage.py dumpdata  > datastore

Django testing applications: using fixtures

2009-09-06 Thread Oleg Oltar
Django testing application: using fixtures Hi ! I came across strange problem while trying to use mixtures in my unittests For example, I created a fixture from the database: silver:jin oleg$ python manage.py dumpdata > datastored.json Strange, but when the fixture is loaded while the t

Re: Django Testing

2009-08-20 Thread Gerard
If you got the tests in your project in a .../tests dir then add a testhelper.py with functions like this: def get_customer_data(self): customer_data = { 'company_name': 'TEST Company', 'company_zipcode': ' XX', 'company_address': 'Test Street 99', 'c

Django Testing

2009-08-20 Thread Vitaly Babiy
I been working on a django project for some time and I keep running in to the problem that fixtures are just to fragile, I was wondering if anyone had a suggestion on how they work around this. Does anyone know of a factory framework for django that I could define a collection of models and have th

Testing code that uses geopy

2009-08-10 Thread Sean Brant
I have written some unit tests that test various parts of code that utilize geopy for determining geo locations. Should I be running my tests using the geocoder class, or should I create a mock class that does not actually ping any services? If creating a mock class is recommended should I specify

Re: Why two identical entries in django.test.utils.ContextList while testing?

2009-08-06 Thread ristretto.rb
that comes with > > subclassing django.test.TestCase. > > > When run code like this > > >  response = self.client.get("/project/usecase") > > > The object response.context is a list type object containing two > > identical Dictionaries. > > The doc f

Re: Why two identical entries in django.test.utils.ContextList while testing?

2009-08-06 Thread Karen Tracey
> The object response.context is a list type object containing two > identical Dictionaries. The doc for this test response attribute: http://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Response.context notes that "If the rendered page used multiple templates, then

Why two identical entries in django.test.utils.ContextList while testing?

2009-08-06 Thread ristretto.rb
Hello, I'm working on some unit tests using the Client that comes with subclassing django.test.TestCase. When run code like this response = self.client.get("/project/usecase") The object response.context is a list type object containing two identical Dictionaries. So, this errors ... sel

Problem with Client()'s cookies in testing framework.

2009-07-20 Thread John Bean
I'm having a problem with the cookies from a Client() disappearing. Here is the example I'm working with (also on dpaste: http://dpaste.com/hold/69285/) # This method works as expected. It does not lose any # cookie information. def followRedirect_working(response, expected_url): """

Re: Flushing the cache during testing

2009-07-17 Thread Russell Keith-Magee
On Sat, Jul 18, 2009 at 6:21 AM, Andrew Fong wrote: > > I'm playing around with some low-level caching of model instances. > During testing, it's necessary for me to flush out the cache so cached > whatnot from one test doesn't pollute another. > > To my know

Flushing the cache during testing

2009-07-17 Thread Andrew Fong
I'm playing around with some low-level caching of model instances. During testing, it's necessary for me to flush out the cache so cached whatnot from one test doesn't pollute another. To my knowledge, Django's currently doesn't offer support for resetting the cache a

Re: New to unit testing, need advice

2009-07-16 Thread Joshua Russo
Great ideas! I've started moving some of my logic that I had in admin.py and views.py into model.py and things are already starting to look easier in terms of testing. My only real hurdle now is testing validation logic on the admin pages and the form creation logic that is the main page t

Re: New to unit testing, need advice

2009-07-16 Thread Javier Guerra
On Thu, Jul 16, 2009 at 3:16 PM, Jumpfroggy wrote: > You could put all these functions into the > models.py file if you wanted, you'd just end up with huge models.py > objects, and you might also run into cases where there is not an > obvious place to put a bit of business logic.  Not every busine

Re: New to unit testing, need advice

2009-07-16 Thread Jumpfroggy
> besides the testing issues (which are certainly a heated debate!), i have to > say that my Django projects became far better organized and a lot more > flexible when i learned to put most of the code on the models, and not on the > views. This is a pretty interesting topic. C

Re: New to unit testing, need advice

2009-07-16 Thread Joshua Russo
On Jul 16, 1:35 pm, Javier Guerra wrote: > On Thu, Jul 16, 2009 at 9:27 AM, Joshua Russo wrote: > > What are some examples of mutating operations (and other operations > > for that matter) that you use in your models? > > the most obvious are: > > - 'calculated' fields.  the first example is the

Re: New to unit testing, need advice

2009-07-16 Thread Javier Guerra
On Thu, Jul 16, 2009 at 9:27 AM, Joshua Russo wrote: > What are some examples of mutating operations (and other operations > for that matter) that you use in your models? the most obvious are: - 'calculated' fields. the first example is the __unicode__() method, but lots others, like multiplyin

Re: New to unit testing, need advice

2009-07-16 Thread Alex Robbins
manager method to make sure it was selecting the right stuff. (Not a mutating operation, but it is model-related) Hope that helps, Alex [1] http://docs.djangoproject.com/en/dev/topics/db/managers/#topics-db-managers On Jul 16, 4:27 am, Joshua Russo wrote: > > besides the testing issues (whi

Re: New to unit testing, need advice

2009-07-16 Thread Joshua Russo
> besides the testing issues (which are certainly a heated debate!), i have to > say that my Django projects became far better organized and a lot more > flexible when i learned to put most of the code on the models, and not on the > views. I find this really interesting because

Re: New to unit testing, need advice

2009-07-16 Thread Daniel Roseman
On Jul 16, 1:20 am, Joshua Russo wrote: > I'm in the process of implementing testing (both doc tests and unit > tests) though I'm having some conceptual difficulty. I'm not sure how > far to take the testing. I'm curious what people concider an > appropriate le

Re: New to unit testing, need advice

2009-07-15 Thread Javier Guerra
Joshua Russo wrote: > This thought struck me most when I was going through the testing > documentation, in the section regarding the testing of models. It > seems to me that very little logic generally goes into the model > classes. At least for me, I have far more logic in

Re: New to unit testing, need advice

2009-07-15 Thread Shawn Milochik
Basically, you want to test anything that might break if another part of the code is changed that interacts with it, might break if the application takes an alternative flow (maybe finally hits the 'else' of that if/else statement), or could possibly receive invalid input. Unfortunately, t

Re: New to unit testing, need advice

2009-07-15 Thread Wayne Koorts
> I'm in the process of implementing testing (both doc tests and unit > tests) though I'm having some conceptual difficulty. I'm not sure how > far to take the testing. I'm curious what people concider an > appropriate level of testing. Uh oh, be ready for a hu

New to unit testing, need advice

2009-07-15 Thread Joshua Russo
I'm in the process of implementing testing (both doc tests and unit tests) though I'm having some conceptual difficulty. I'm not sure how far to take the testing. I'm curious what people concider an appropriate level of testing. This thought struck me most when I was going

Re: Unit testing views.

2009-07-11 Thread J. Clifford Dyer
Woot! Thank you. I'll be pestering my sysadmins about that starting with our Tuesday meeting this week. :) Cheers, Cliff On Sat, 2009-07-11 at 22:32 +0800, Russell Keith-Magee wrote: > On Fri, Jul 10, 2009 at 1:02 PM, J. Clifford Dyer > wrote: > > > > On Fri, 2009-07-10 at 07:58 +0800, Russe

Re: Unit testing views.

2009-07-11 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 1:02 PM, J. Clifford Dyer wrote: > > On Fri, 2009-07-10 at 07:58 +0800, Russell Keith-Magee wrote: >> On Fri, Jul 10, 2009 at 3:23 AM, J. Cliff Dyer wrote: >> > > I am using the django testcase, but without fixtures, because loading > fixtures is busted when you use a m2m r

Re: Automated Functional Testing

2009-07-10 Thread Kevin Teague
r tests in Python, then zope.testbrowser behaves more-or-less the same as Canoo (automated functional black-box browser testing) except you can write your tests in Python. Although it's Python only, I haven't seen anyone develop a Firefox recorder plug-in which would generate zope.tes

Re: Unit testing views.

2009-07-09 Thread J. Clifford Dyer
On Fri, 2009-07-10 at 07:58 +0800, Russell Keith-Magee wrote: > On Fri, Jul 10, 2009 at 3:23 AM, J. Cliff Dyer wrote: > > > > I'm trying to get my django site under tests. I've started testing my > > pages using Client('url/to/my/page'), but I noticed t

Re: Unit testing views.

2009-07-09 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 3:23 AM, J. Cliff Dyer wrote: > > I'm trying to get my django site under tests.  I've started testing my > pages using Client('url/to/my/page'), but I noticed that each test takes > about a second to run (just to get a response code for the

Unit testing views.

2009-07-09 Thread J. Cliff Dyer
I'm trying to get my django site under tests. I've started testing my pages using Client('url/to/my/page'), but I noticed that each test takes about a second to run (just to get a response code for the page--very basic tests). First of all, it seems like the client go t

Automated Functional Testing

2009-07-08 Thread Software Testing Training
Automated Functional Testing By Bhrigu Malhotra ( http://www.qacampus.com ) First of all let me make you all aware that I’m a developer and what you are going to read further is a developer’s account, so it may sound to you like a layman tester. But what I’m going to share is something which

Re: any ideas about "load testing" django apps?

2009-07-08 Thread Alex Gaynor
On Wed, Jul 8, 2009 at 3:52 PM, happyb787 wrote: > > Any ideas about load testing django apps? JMeter? Ab? > > Please advise. thanks! > > > > You'd use the same tools you use for any other HTTP application, I've heard good things about Ab and Siege. Alex

any ideas about "load testing" django apps?

2009-07-08 Thread happyb787
Any ideas about load testing django apps? JMeter? Ab? Please advise. thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Template tag testing

2009-06-23 Thread brianmac44
newmanutils/tests.py Thanks Michael. That was a good start for me. My tag needed some context from the testing client. http://dpaste.com/58833/ -Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: Template tag testing

2009-06-23 Thread Michael
On Tue, Jun 23, 2009 at 11:53 AM, brianmac44 wrote: > > I tried to test template tags with doctests and unittests but I'm not > sure what token and/or context to use. What's the best practice for > testing template tags? > I don't know if this is best practice,

Template tag testing

2009-06-23 Thread brianmac44
I tried to test template tags with doctests and unittests but I'm not sure what token and/or context to use. What's the best practice for testing template tags? Thanks, Brian --~--~-~--~~~---~--~~ You received this message because you are subscri

App-centric development and testing

2009-06-14 Thread Masklinn
I'm finally getting into actually testing my apps, but since Django's test system requires a settings file, I was wondering how it was usually handled: per-app settings file (versioned with the app?)? Global settings file with all the apps of the system enabled? Each app req

Testing Django Templates

2009-06-08 Thread Andrew Fong
I'm trying to get into a better testing flow with Django. One of things I'm trying to figure out how to test are templates. Using the Django Test Client works fine, for instance, in detecting whether I have a missing template tag (because it'll explode) or if I don't pass a pa

Re: Implementing A/B Testing in Django

2009-05-18 Thread John Boxall
Using template_loader idea I've developed a little pluggable app for conducting basic A/B tests. You can grab it here: http://github.com/johnboxall/django-ab/tree/master John On May 16, 9:04 pm, John Boxall wrote: > I've got a new home page and I'd like to test it's performance in > getting us

Re: Implementing A/B Testing in Django

2009-05-18 Thread John Boxall
Thanks Tino, I am aware of GWO - just thought it would be a cool project to try! It looks like the local threads / request object available in the template loader trick is going to work - just gotta clear up some possible caching issues then it'll be ready for release. Cheers, John On May 17,

Re: Implementing A/B Testing in Django

2009-05-17 Thread TiNo
> > Does anyone have any other ideas or suggestions about how to > dynamically show templates to users in a pluggable way while at the > same time measuring what template the user sees? > It's not about doing it in Django, but you know that Google Website Optimizer does this, and provides you out

Implementing A/B Testing in Django

2009-05-16 Thread John Boxall
I've got a new home page and I'd like to test it's performance in getting users to sign up compared to my existing home page. In Django terms I have two templates that I would like my existing view to alternate between - I want to make whatever template the viewer sees "sticky" - they see the sam

Re: Google website optimizer--A/B testing

2009-05-12 Thread Baxter
On May 12, 9:02 am, "bax...@gretschpages.com" wrote: > Does anyone know how one would do A/B testing a la Google Website > Optimizer with Django? Some sort of middleware, maybe? Disregard. After reading Google's docs a bit, all you have to do is create an alternate URL,

Google website optimizer--A/B testing

2009-05-12 Thread bax...@gretschpages.com
Does anyone know how one would do A/B testing a la Google Website Optimizer with Django? Some sort of middleware, maybe? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Testing and 'module' object has no attribute 'handler500'

2009-05-06 Thread rvdrijst
I had the same problem but it turned out to be me, not django. See http://code.djangoproject.com/ticket/11013#comment:1 (your ticket I believe). Regards, -Robin On Apr 28, 1:02 pm, Filip Gruszczyński wrote: > I am trying to write a tests and want to try out calling some wrong > addresses, to se

Re: testing suite fails on auth

2009-05-05 Thread DZPM
Happened something similar to me, with test_no_remote_user and test_unknown_user. It's been fixed in trunk: http://code.djangoproject.com/changeset/10674 The ticket was: http://code.djangoproject.com/ticket/10521 -- David Arcos Sebastián On Mar 31, 4:35 pm, Filip Gruszczyński wrote: > I hav

Testing and 'module' object has no attribute 'handler500'

2009-04-28 Thread Filip Gruszczyński
I am trying to write a tests and want to try out calling some wrong addresses, to see if they all return correctly 404 or 403. But when I run get operations, that should those, I get Exception 'module' object has no attribute 'handler500'. I tried to check docs and googled, but found no informatio

Re: doctest testing with templatefilters

2009-04-23 Thread Jari Pennanen
 pm, Jari Pennanen wrote: > Hi! > > I'm just wondering the same thing, not exact same, but this: > > How do I run doctests when doing "./manage.py test myapp", where > should I define doctest.testmod(...) lines? In root of tests.py it > doesn't work. > >

Re: doctest testing with templatefilters

2009-04-23 Thread Jari Pennanen
Hi! I'm just wondering the same thing, not exact same, but this: How do I run doctests when doing "./manage.py test myapp", where should I define doctest.testmod(...) lines? In root of tests.py it doesn't work. On Apr 12, 7:51 pm, Julian wrote: > hello, > > I

Re: dynamically testing for response.context or response.context[0]

2009-04-22 Thread Russell Keith-Magee
On Thu, Apr 23, 2009 at 5:06 AM, meppum wrote: > > sorry to bring this up again in a different thread, but the old thread > was locked: > http://groups.google.com/group/django-users/browse_thread/thread/4fe2774b35b14b82/5af08bf613ba1f4c?lnk=gst&q=meppum+template+test#5af08bf613ba1f4c > > is there

doctest testing with templatefilters

2009-04-12 Thread Julian
hello, I am testing some of my filters with doctests. it's very easy, but I have to call the module with the filters manually: python /foo/bar/templatetags/eggs_extra.py -v to let the doctest run. Now I've added at the end of the egg.py the following code: def run_doctest():

Re: testing with a mock object

2009-03-31 Thread Daniel Roseman
On Mar 31, 7:39 pm, belred wrote: > i have a questions about mock objects.  i currently have a django view > function that calls a 2nd function.  this second function calls > urllib2.urlopen.   i was thinking about adding in a mock object so i > can get some better code coverage in the 2nd functi

testing with a mock object

2009-03-31 Thread belred
i have a questions about mock objects. i currently have a django view function that calls a 2nd function. this second function calls urllib2.urlopen. i was thinking about adding in a mock object so i can get some better code coverage in the 2nd function when calling manage.py test. my first

testing suite fails on auth

2009-03-31 Thread Filip Gruszczyński
I haven't yet created any my own tests and just run ./manage.py test. This is what I got: ...FFF.. == ERROR: test_known_user (django.contrib.auth.tests.remote_user.RemoteUserCustomTest) ---

Re: Testing form posting

2009-03-29 Thread Martin Ostrovsky
You're POSTing the form instance, rather than the postedData. So: response = self.client.post('/myApp/post', form) should be: response = self.client.post('/myApp/post/', postedData) More info here: http://docs.djangoproject.com/en/dev/topics/testing/#making-req

Testing form posting

2009-03-28 Thread tsmets
I was wondering how I could test / unittest form posting ? class TestSomeRequest(TestCase): def testCallDefaultDpasteURL(self): response = self.client.get('/my_app/') self.failUnlessEqual(response.status_code, 200) def testCallDpasteAboutURL(self): postedData = { 'poster

Re: Testing

2009-03-19 Thread Filip Gruszczyński
d tests.py in your application. > > An example of testing a view with doctests can be found here: > http://docs.djangoproject.com/en/dev/topics/testing/#overview-and-a-quick-example > > Preston > > > > On Mar 18, 6:34 pm, Filip Gruszczyński wrote: >> I am trying to ha

Re: Testing

2009-03-18 Thread Preston Timmons
Hi Filip, The Django test runner looks for tests in two places in an application--the models.py file and an optional tests.py file. If you want to run tests for your views you can move your tests into a file called tests.py in your application. An example of testing a view with doctests can be

Testing

2009-03-18 Thread Filip Gruszczyński
I am trying to have my function tested using docstring with examples. When I put it into models.py of an app, it gets tested. If I put it into views.py, it is not tested; this happens also, if I add another module (which I import). How can make testing framework test those? -- Filip

Re: Browser Testing - Selenium or Windmill

2009-02-28 Thread Ryan Kelly
> What's the best tool for doing automated browser testing with Django > apps? I have some personal experience with Selenium (although not when > testing Django), which seems fairly mature, and has a great Firefox > extension, but has some serious problems dealing with frame

Browser Testing - Selenium or Windmill

2009-02-28 Thread Chris
What's the best tool for doing automated browser testing with Django apps? I have some personal experience with Selenium (although not when testing Django), which seems fairly mature, and has a great Firefox extension, but has some serious problems dealing with frames and popups. I rec

django.test HTTP/XMLRPC Testing with use of settings.TEST_DATABASE_NAME

2009-02-26 Thread x_O
Hi Recently I'm trying to write tests for almost every thing in my code. Including HTTP and XMLRPC requests. from django.test import TestCase class XmlRpcCase(TestCase): def setUp(self): self.xmlrpc = xmlrpclib.ServerProxy("http://127.0.0.1:8000/ store/xmlrpc") def testCreate(s

Re: testing validation of form in unit testing

2009-02-20 Thread Vitaly
Here's the code that process all steps in unittest with checking validation form: http://dpaste.com/123059/ What I have tryed is to collect data myself as fixture to test the form validation. Thanks On Feb 20, 7:00 pm, Briel wrote: > You don't give a lot information about what is happening, s

Re: testing validation of form in unit testing

2009-02-20 Thread Briel
You don't give a lot information about what is happening, so I'm stabbing a bit in the dark here... I would guess your problem is that you have created a form which has a filefield that is required. Even though you probably upload a file and maybe even pass it to the form, you are not doing it in

testing validation of form in unit testing

2009-02-20 Thread Vitaly
Hi all I have a test that validate processed data to form with FileField. My steps in it direct me right to one problem. here is it. 'file' is 'Required field' What I do is process simple data right to form, not request.POST and request.FILES. I have tried process in data SimpleUploadedFile but

Re: Testing Django and HTTP Request

2009-02-09 Thread Vitaly Babiy
use. >>>>>>> I think I need to find a way to start a HTTP server at the beginning >>>>>>> of the test and keep it around till all test are done. And have a way to >>>>>>> tell the server what to return on the request. >>>>>>

Re: Testing Django and HTTP Request

2009-02-09 Thread Vitaly Babiy
;>>>>> of the test and keep it around till all test are done. And have a way to >>>>>> tell the server what to return on the request. >>>>>> >>>>>> Vitaly Babiy >>>>>> >>>>>> >>>>>>

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
way to start a HTTP server at the beginning of >>>>> the test and keep it around till all test are done. And have a way to tell >>>>> the server what to return on the request. >>>>> >>>>> Vitaly Babiy >>>>> >>>>> >>>>

Re: Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
t;> Vitaly Babiy >>>> >>>> >>>> On Mon, Feb 9, 2009 at 12:08 AM, Alex Gaynor wrote: >>>> >>>>> >>>>> >>>>> On Mon, Feb 9, 2009 at 12:06 AM, Vitaly Babiy wrote: >>>>> >>>>>

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
; Vitaly Babiy >>> >>> >>> On Mon, Feb 9, 2009 at 12:08 AM, Alex Gaynor wrote: >>> >>>> >>>> >>>> On Mon, Feb 9, 2009 at 12:06 AM, Vitaly Babiy wrote: >>>> >>>>> Hello everyone, >>>>> &

Re: Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
9, 2009 at 12:06 AM, Vitaly Babiy wrote: >>> >>>> Hello everyone, >>>> >>>> I am working on a project that will need to make a request out to the >>>> web and pull down some data, For testing purpose I was wonder what would be >>>

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
t 12:06 AM, Vitaly Babiy wrote: >> >>> Hello everyone, >>> >>> I am working on a project that will need to make a request out to the web >>> and pull down some data, For testing purpose I was wonder what would be the >>> best way to test this. I do

Re: Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
d to make a request out to the web >> and pull down some data, For testing purpose I was wonder what would be the >> best way to test this. I don't want to make the actual request during the >> test, because for one if I am off-line all those tests will fail. >> >> I

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:06 AM, Vitaly Babiy wrote: > Hello everyone, > > I am working on a project that will need to make a request out to the web > and pull down some data, For testing purpose I was wonder what would be the > best way to test this. I don't want to mak

Testing Django and HTTP Request

2009-02-08 Thread Vitaly Babiy
Hello everyone, I am working on a project that will need to make a request out to the web and pull down some data, For testing purpose I was wonder what would be the best way to test this. I don't want to make the actual request during the test, because for one if I am off-line all those

Re: Testing uploads and content types

2009-01-23 Thread Julien Phalip
v/topics/http/file-uploads/#upload... > > > > John > > > Hi John, > > > Thanks for your reply. The snippet you've given is the kind of things > > my view already does. The problem is that, when testing with > > self.client.post(), all files are systema

Re: Testing uploads and content types

2009-01-23 Thread Malcolm Tredinnick
hn, > > Thanks for your reply. The snippet you've given is the kind of things > my view already does. The problem is that, when testing with > self.client.post(), all files are systematically encoded as > 'application/octet-stream'. To test the behaviour of my view I

Re: Testing uploads and content types

2009-01-23 Thread Julien Phalip
t know if this will help you in your test. I hope it does. > > [1]http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#upload... > > John Hi John, Thanks for your reply. The snippet you've given is the kind of things my view already does. The problem is that, when testin

Re: Testing uploads and content types

2009-01-23 Thread varikin
On Jan 23, 1:39 am, Julien Phalip wrote: > I have a view which processes a multi-part form and whose behaviour > varies depending on the content types of the uploaded files. I've > written some tests for that view as follows: > >         post_data = { >             'name1': 'blah', >            

Testing uploads and content types

2009-01-22 Thread Julien Phalip
Hi, I have a view which processes a multi-part form and whose behaviour varies depending on the content types of the uploaded files. I've written some tests for that view as follows: post_data = { 'name1': 'blah', 'file_field1': image_data, } respo

Re: Why Django doesn't force testing?

2009-01-05 Thread Емил Иванов / Emil Ivanov
As Russell Keith-Magee suggested having a tutorial on how to do testing is a good way to go. Modifying the django tutorial in the docs to include testing in it should help new-commers get used to testing. Also, having tests in the docs should help convince people that testing is the right way

Re: Why Django doesn't force testing?

2009-01-05 Thread HB
> Your email client apparently failed to generate tests for your > message, resulting in a misunderstanding. Which leads us to that we should be forced to write tests, not encouraged :) On Jan 5, 3:30 pm, James Bennett wrote: > On Jan 5, 6:04 am, HB wrote: > > > Sure, I mean encourage not force

Re: Why Django doesn't force testing?

2009-01-05 Thread James Bennett
On Jan 5, 6:04 am, HB wrote: > Sure, I mean encourage not force :) Your email client apparently failed to generate tests for your message, resulting in a misunderstanding. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Why Django doesn't force testing?

2009-01-05 Thread alex.gay...@gmail.com
e > valid. > When I say "encourage testing" I mean generating tests cases whenever > we create a Django entity (like model for example). > Creating integration testing (like Seam application tests). > Include code coverage tool. > Include code complexity tool. > Supports profi

Re: Why Django doesn't force testing?

2009-01-05 Thread HB
I'm a Java guy playing around Django so what I will say may not be valid. When I say "encourage testing" I mean generating tests cases whenever we create a Django entity (like model for example). Creating integration testing (like Seam application tests). Include code coverage too

Re: Why Django doesn't force testing?

2009-01-05 Thread Russell Keith-Magee
On Mon, Jan 5, 2009 at 9:04 PM, HB wrote: > > Sure, I mean encourage not force :) Ok, then - what could we do to encourage testing? We have a test framework; it is documented, there are plenty of blog entries around that discuss how to use it, and there are some utilities in the com

Re: Why Django doesn't force testing?

2009-01-05 Thread HB
Sure, I mean encourage not force :) On Jan 5, 1:53 pm, Malcolm Tredinnick wrote: > On Mon, 2009-01-05 at 03:27 -0800, HB wrote: > > Hey, > > One nice thing about JBoss Seam and Rails is they encourage unit > > testing from the very beginning. > > Django as an agile

Re: Why Django doesn't force testing?

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 03:27 -0800, HB wrote: > Hey, > One nice thing about JBoss Seam and Rails is they encourage unit > testing from the very beginning. > Django as an agile web framework, why doesn't follow the same > philosophy? Your assumption seems to be mistaken.

Re: Why Django doesn't force testing?

2009-01-05 Thread Manuel Schmidt
Why should django encourage? Django offers everything one needs to do it so if you want to unit test your code, you can just do it. And if you dont care, you can either. HB schrieb: > Hey, > One nice thing about JBoss Seam and Rails is they encourage unit > testing from the very

Re: Why Django doesn't force testing?

2009-01-05 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-01-05, o godz. 12:27, przez HB: > One nice thing about JBoss Seam and Rails is they encourage unit > testing from the very beginning. > Django as an agile web framework, why doesn't follow the same > philosophy? Because it's a "web frame

Why Django doesn't force testing?

2009-01-05 Thread HB
Hey, One nice thing about JBoss Seam and Rails is they encourage unit testing from the very beginning. Django as an agile web framework, why doesn't follow the same philosophy? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Jason Sidabras
hidden field also. > > > So when the send button is pushed it sends both the sender_id="2" (or > > whichever user) and the username="test_userwith_pk2" > > > So when I am testing and I have an anonymous user a simple post will > > work to test my

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Malcolm Tredinnick
user is logged in the template > uses the pk_id from the user (in the case of non-admin pk=2 and up) > and then places the username a hidden field also. > > So when the send button is pushed it sends both the sender_id="2" (or > whichever user) and the username="test_

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Jason Sidabras
-admin pk=2 and up) and then places the username a hidden field also. So when the send button is pushed it sends both the sender_id="2" (or whichever user) and the username="test_userwith_pk2" So when I am testing and I have an anonymous user a simple post will work to test my view

Re: Unit Testing forms with hidden fields

2008-12-08 Thread Malcolm Tredinnick
On Mon, 2008-12-08 at 15:00 -0800, Jason Sidabras wrote: > Hello, > > I am working on adding unit testing to my code and the snag I have > come across is in regards to unit fields. > > When user.is_anonymous() I have a hidden field sender_id = 1 which is > easy

Unit Testing forms with hidden fields

2008-12-08 Thread Jason Sidabras
Hello, I am working on adding unit testing to my code and the snag I have come across is in regards to unit fields. When user.is_anonymous() I have a hidden field sender_id = 1 which is easy to test by: from django.test.client import Client c = Client() c.post('sender_id':

Re: testing template tags

2008-12-02 Thread Richard Szopa
Thanks a lot. For some reason I haven't noticed the relevant fragment in the docs... Cheers, -- Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: testing template tags

2008-12-01 Thread Malcolm Tredinnick
gt; not sufficient. Are you assuming that "manage.py test my_app" runs all doctests in every file? Because that isn't the case. Quoting http://docs.djangoproject.com/en/dev/topics/testing/ : For a given Django application, the test runner looks

testing template tags

2008-12-01 Thread Richard Szopa
Hello, I have written some doctests for my custom template tags, but `manage.py test my_app' doesn't seem to notice it. There is an __init__.py file in the templatetags directory, but apparently that is not sufficient. Thanks in advance, -- Richard --~--~-~--~~~-

<    3   4   5   6   7   8   9   10   11   >