Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion test cannot find assertContains
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mike Ramirez  
View profile  
 More options Mar 14 2011, 1:40 am
From: Mike Ramirez <gufym...@gmail.com>
Date: Sun, 13 Mar 2011 22:40:51 -0700
Local: Mon, Mar 14 2011 1:40 am
Subject: Re: test cannot find assertContains

On Sunday, March 13, 2011 09:58:18 pm Kenneth Gonsalves wrote:

> On Sat, 2011-03-12 at 00:12 -0800, Mike Ramirez wrote:
> > On Friday, March 11, 2011 11:37:38 pm Kenneth Gonsalves wrote:
> > > and all is well. I think the dev docs need to be clearer on this

> > point

> > > and mention this at the outset. After all they *are* dev docs.

> > http://docs.djangoproject.com/en/1.2/topics/testing/#testcase

> I know it is there - but it is half way down the page. My point is that
> it should be at the top of the page. For what it's worth I filed a
> ticket.

I've een wondering about this myself, but I'm not sure that it's in the wrong
place, but it's not in the perfect place.

 IMO, it's in its natural place if you apply how the other docs are split up.
Testing is a single page and doesn't benefit from the seperation say something
like forms gets. This is where the problem probably lies.

If you look at the forms api, it describes the basic forms api with just
forms.Form, and goes into how to use the forms, later on you run into
forms.ModelForm in it's own page. All of this depends on prior knowledge and
steps down in a logical pattern i.e. forms, fields, widgets.

Testing works the same way, introducing the basic unit testing functionality,
including how to build simple tests. Then works through running them. I think
it's natural to stop reading there, but we are intended to continue on down
through the whole page as it builds on itself, like the rest of the docs.

Also starting with unittest shows that we can use unittest as we need (in a
non django lib, for example a img lib for handling all the image
resizes/changes we may want. this wouldn't require any django related tests.
There is no questioning the if testrunner will question these. Also ending
with testing.TestCase leaves that fresher in our minds as it's the last thing
we read (theoretically).  

ftr, in atleast 1.2.3 forward startapp generates a tests.py with this code:

[gmike@priss keis]$ cat newfun/tests.py
"""
This file demonstrates writing tests using the unittest module. These will
pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase

class SimpleTest(TestCase):
    def test_basic_addition(self):
        """
        Tests that 1 + 1 always equals 2.
        """
        self.assertEqual(1 + 1, 2)

*note: 1.2.3 also has docstring tests included as part of the sample/exmaple.

With this all in mind, I think they do enough to say use 'django.testing',
without having it specifically marked at the start.

But it could possibly benefit from being two pages, one an "overview" and one
page for "django.testing"

Mike

--
solar flares


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.