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):
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):
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
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 = Client()
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 initial_data.
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 PROTEC
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 un
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
> 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
--~--~-~--~~~---~--~
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/document
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 error
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):
se
12 matches
Mail list logo