Code

Opened 5 years ago

Closed 5 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 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: UI/UX:

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.

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 5 years ago by batiste

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 Changed 5 years ago by kmtracey

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

comment:4 Changed 5 years ago by batiste

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.