Re: testing login problem

2008-07-03 Thread laspal
Hey I am able to run the test by using : class IndustryTest(TestCase): fixtures = ['/fixtures/initial_data.xml'] def setUp(self): self.client = Client() response =self.client.post('/ibms/login/', {'username':'laspal', 'password':'abcd'}) def test_addIndustry( self):

Re: testing login problem

2008-07-03 Thread laspal
Hey I am able to run the test by using : class IndustryTest(TestCase): fixtures = ['/fixtures/initial_data.xml'] def setUp(self): self.client = Client() response =self.client.post('/ibms/login/', {'username':'laspal', 'password':'abcd'}) def test_addIndustry( self):

Re: testing login problem

2008-07-03 Thread Nick Sandford
On Thu, Jul 3, 2008 at 2:18 PM, laspal <[EMAIL PROTECTED]> wrote: > > Hi, > Thanks for the help but still I am not able to login in my test > client.. > > here is the code: > > from django.test import TestCase > from django.test.client import Client > > class IndustryTest(TestCase): >fixtures

Re: testing login problem

2008-07-03 Thread laspal
Hi, Thanks for the help but still I am not able to login in my test client.. here is the code: from django.test import TestCase from django.test.client import Client class IndustryTest(TestCase): fixtures = ['/fixtures/initial_data.xml'] def setUp(self): self.client =

Re: testing login problem

2008-07-02 Thread Russell Keith-Magee
On Wed, Jul 2, 2008 at 10:14 PM, Norman Harman <[EMAIL PROTECTED]> wrote: > > Test system creates a new test database from scratch every time it is > run. manage.py loaddata has NO effect on test. > > I could be wrong but I don't believe test runner automatically loads the > fixture

Re: testing login problem

2008-07-02 Thread [EMAIL PROTECTED]
You can check my dump of manage.py test (ran as root) here; http://dpaste.com/60433/ As you can see the fixture load runs OK... and I even got a couple of errors on the load process! That sure confirms the fixtures load ;-) Tests run fine though. On Jul 2, 4:14 pm, "Norman Harman" <[EMAIL

Re: testing login problem

2008-07-02 Thread Norman Harman
laspal wrote: > Hi, > I have created initial_data.xml using dumpdata and > """manage.py loaddata initial_data.xml""" gives me no error. > but still I am not able to login using setUp().. and this is > essential as all my views functions required login.. > > here is my test file: > > import

Re: testing login problem

2008-07-02 Thread laspal
Hi, I have created initial_data.xml using dumpdata and """manage.py loaddata initial_data.xml""" gives me no error. but still I am not able to login using setUp().. and this is essential as all my views functions required login.. here is my test file: import unittest from django.test import

Re: testing login problem

2008-07-01 Thread [EMAIL PROTECTED]
> How do I create username and password for the test database. What I do is either create a test user on SetUp(), or put that username inside the "initial_data" fixture, which loads automatically when Django creates the test DB... HTH, Carlos

Re: testing login problem

2008-07-01 Thread laspal
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

Re: testing login problem

2008-07-01 Thread Julien
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

testing login problem

2008-07-01 Thread laspal
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):