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
#7611 contrib.auth PasswordResetTest requires specific templates for tests to pass
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Jason Yan  
View profile  
 More options Jul 19 2008, 1:58 am
From: Jason Yan <tailofthe...@gmail.com>
Date: Fri, 18 Jul 2008 22:58:51 -0700 (PDT)
Local: Sat, Jul 19 2008 1:58 am
Subject: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass
Re: http://code.djangoproject.com/ticket/7611

The current situation is that if you create a new Django project and
run the unit tests, the contrib.auth baisc tests fail due to missing
templates.  These templates are provided by the admin app, which is
not installed by default.  Russell brought up some points which made
me think about this more.  My initial implementation was to force the
inclusion of the admin app if it wasn't already installed, but I agree
with Russell's initial comment that it isn't testing for the presence
of the admin app.

I believe that we should not run these tests if we cannot find the
templates for the same reason we don't run Docutils tests if docutils
is not installed.  Though the error reported that the template is not
found is "correct", I don't believe it is a correct test failure
because that is not the goal of the test case.


 
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.
Russell Keith-Magee  
View profile  
 More options Jul 19 2008, 2:15 am
From: "Russell Keith-Magee" <freakboy3...@gmail.com>
Date: Sat, 19 Jul 2008 14:15:26 +0800
Local: Sat, Jul 19 2008 2:15 am
Subject: Re: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass

I disagree. Like I say in the comment for the ticket, you can't claim
that the auth application works correctly in your project if those
templates are not available.

The comparison with docutils tests is slightly off target. There is an
argument to me made for skipping those tests - but not because we
can't find the templates. Failing due to the non-existence of the
templates is a legitimate failure if the user is actually using the
views.

However, if the user is _not_ using the views (e.g., they're using the
auth.User model, but providing their own login views), there is an
argument to be made for skipping the tests.

There could actually be an overlap here with #4788 - that ticket calls
for a mechanism to skip and report tests that are known and acceptable
failures. Providing a project-level way to skip tests that are known
failures could be one solution to both problems.

Yours
Russ Magee %-)


 
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.
Jason Yan  
View profile  
 More options Jul 19 2008, 3:07 am
From: Jason Yan <tailofthe...@gmail.com>
Date: Sat, 19 Jul 2008 00:07:13 -0700 (PDT)
Local: Sat, Jul 19 2008 3:07 am
Subject: Re: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass

> However, if the user is _not_ using the views (e.g., they're using the
> auth.User model, but providing their own login views), there is an
> argument to be made for skipping the tests.

Is it safe to say that if we try to
reverse('django.contrib.auth.views.password_reset'), we should not run
the tests?  This would negate the use of urls that was introduced in
#7521.  The patch you submitted for loading test templates in #7611
seems to complement the use of urls from #7521 in TestCase.  I feel it
should be both or none.  In the latter case, we should simply skip the
test case if django.contrib.auth.views.password_reset is not used.

 
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.
Jason Yan  
View profile  
 More options Jul 19 2008, 4:10 am
From: Jason Yan <tailofthe...@gmail.com>
Date: Sat, 19 Jul 2008 01:10:37 -0700 (PDT)
Local: Sat, Jul 19 2008 4:10 am
Subject: Re: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass
I attached a new patch to the ticket in the original post.  The hard-
coded URL felt like it went against your reasoning for testing the
auth application in your own project, so hopefully this approach gives
us the best of both worlds.  Without a proper way to skip test cases
yet, I decided to follow what other tests did and pass the test in the
case where the test is actually skipped.

 
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.
sciyoshi  
View profile  
 More options Sep 6 2008, 9:32 pm
From: sciyoshi <sciyo...@gmail.com>
Date: Sat, 6 Sep 2008 18:32:20 -0700 (PDT)
Local: Sat, Sep 6 2008 9:32 pm
Subject: Re: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass
On Jul 19, 2:15 am, "Russell Keith-Magee" <freakboy3...@gmail.com>
wrote:

> On Sat, Jul 19, 2008 at 1:58 PM, Jason Yan <tailofthe...@gmail.com> wrote:

> > Re:http://code.djangoproject.com/ticket/7611

> > I believe that we should not run these tests if we cannot find the
> > templates for the same reason we don't run Docutils tests if docutils
> > is not installed.  Though the error reported that the template is not
> > found is "correct", I don't believe it is a correct test failure
> > because that is not the goal of the test case.

> I disagree. Like I say in the comment for the ticket, you can't claim
> that the auth application works correctly in your project if those
> templates are not available.

Not sure if this should be considered a related issue - the auth tests
use a different urlconf that only include the auth urls, so if you
provide custom registration templates that do reverse lookups with {%
url %} for other urls in your projects, the tests fail...

 
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.
Siddhi  
View profile  
 More options Oct 31 2008, 10:06 pm
From: Siddhi <siddharta.li...@gmail.com>
Date: Fri, 31 Oct 2008 19:06:17 -0700 (PDT)
Local: Fri, Oct 31 2008 10:06 pm
Subject: Re: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass
On Sep 7, 6:32 am, sciyoshi <sciyo...@gmail.com> wrote:

> On Jul 19, 2:15 am, "Russell Keith-Magee" <freakboy3...@gmail.com>
> wrote:

> Not sure if this should be considered a related issue - theauthtests
> use a different urlconf that only include theauthurls, so if you
> provide custom registration templates that do reverse lookups with {%
> url %} for other urls in your projects, the tests fail...

Exactly, I ran into this problem as well. By overriding the urls, all
the other reverse lookups in the template start failing. Maybe reverse
lookups should fail silently while running under a unit tests?

--
Siddharta Govindaraj
http://siddhi.blogspot.com
http://www.silverstripesoftware.com/blog/


 
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.
Matt Brown  
View profile  
 More options Nov 10 2008, 3:19 pm
From: Matt Brown <matt...@gmail.com>
Date: Mon, 10 Nov 2008 12:19:37 -0800 (PST)
Local: Mon, Nov 10 2008 3:19 pm
Subject: Re: #7611 contrib.auth PasswordResetTest requires specific templates for tests to pass
Not intending to derail the test-skip angle (which sounds generally
useful), but in this case, wouldn't a better fix be to eliminate the
dependency on admin, by providing the needed templates in the auth
test suite itself?  PasswordResetTest could also duplicate the setup/
teardown methods used by ChangePasswordTest, to ensure that the
correct templates are used during the test.

- Matt Brown


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »