How do I create username and password for the test database.

On Jul 1, 2:24 pm, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If you're using the SVN version you can try:
>
> >>> c = Client()
> >>> c.login(username='fred', password='secret')
>
> More info here:http://www.djangoproject.com/documentation/testing/
>
> On Jul 1, 5:51 pm, laspal <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I am writing the test case but I am getting errors.
>
> > Test case is as follows:
>
> > import unittest
>
> > from django.test.client import Client
> > from django.contrib.auth.models import User, Group
> > from ibm.crm.models import Industry
>
> > class IndustryTest(unittest.TestCase):
>
> >     def setUp(self):
> >         self.client = Client()
> >         response =self.client.post('/ibm/login/',
> > {'username':'laspal', 'password':'abcd'})
> >         print response
>
> > Getting error :
>
> > <form method="post" action=".">
>
> >                       <p>Your username and password didn't match.
> > Please try again.</p>
>
> > <tr><td align="right" width="50%"><label
> > for="id_username">Username :&nbsp;&nbsp;</label></td><td align="right"
> > width="50%" class="loginbox"><input type="text" id="id_username"
> > class="vTextField required" name="username" size="15" value="laspal"
> > maxlength="30" /></td></tr>
> >                 <tr><td align="right"><label
> > for="id_password">Password :&nbsp;&nbsp;</label></td><td align="right"
> > width="50%" class="loginbox"><input type="password" id="id_password"
> > class="vPasswordField required" name="password" size="15" value="abcd"
> > maxlength="30" /></td></tr>
> >                 <tr><td colspan="2" align="right"><input
> > class="button" type="submit" value="login" /></td></tr>
>
> > </form>
>
> > So my problem is its not getting login.
> > with same username and login I am able to login in the UI.
> > Does I have to include anything??
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to