Opened 15 years ago

Closed 15 years ago

#10226 closed (fixed)

dango.test.client.Client raise a value error when used against the admin with a get parameter

Reported by: Batiste Bieler Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello,

I have this problem when I want to test my admin application:

Hello, I have the same error with this test:

from django.test import TestCase

from datetime import datetime



class PostBugTestCase(TestCase):



    fixtures = ['tests.json']



    def test_stuff(self):



        from django.test.client import Client

        c = Client()

        data = {'question':'test', 'pub_date':datetime.now()}

        print c.login(username='batiste', password='b')

        response = c.post('/admin/toto/poll/add/?toto=true', data)

        self.assertRedirects(response, '/admin/toto/poll/')




>>> ./manage test
ValueError: invalid literal for int() with base 10: 'add/?toto=true'

I use the Poll model from the tutorial to show the problem.

Change History (4)

comment:1 by Karen Tracey, 15 years ago

I cannot recreate this. What version of Django are you using exactly: released 1.0, 1.0.2, current 1.0.X branch, current trunk?

Is there really no traceback included with the ValueError?

comment:2 by Batiste Bieler, 15 years ago

I use the 1.0.2 released version. I will try with the trunk to see if it's fixed. Could I paste the traceback here?

comment:3 by Karen Tracey, 15 years ago

The traceback would be useful. Put it in {{{ }}} to prevent messed up formatting.

comment:4 by Batiste Bieler, 15 years ago

Resolution: fixed
Status: newclosed

I tried with the trunk and the test pass. Sorry to not have checked before.

Note: See TracTickets for help on using tickets.
Back to Top