1. David Wolever
  2. urlqueue

Commits

David Wolever  committed 0ce4ff8

Fixing unicode bug.

  • Participants
  • Parent commits ae20d17
  • Branches default

Comments (0)

Files changed (2)

File queue/tests.py

View file
         resp = c.post('/queue/empty_queue/dequeue')
         self.assertTemplateUsed(resp, 'queue/queue_empty.html')
 
+    def test_dequeue_unicode(self):
+        new_queued_url(url=u"http://f\u00F8\u00F8")
+        c = Client()
+
+        resp = c.post('/queue/default/dequeue')
+        assert_equal(resp.status_code, 302)
+        # I don't know exactly what this should be... But strangely encoded
+        # is doubtless better than crashing.
+        assert_equal(resp['Location'], "http://f%C3%B8%C3%B8")
+
     def test_dequeue_full(self):
         setup_default_data()
         c = Client()

File queue/views.py

View file
         return render_to_response('queue/queue_empty.html', data)
 
     qrl.dequeue()
-    return redirect(qrl.url)
+    return redirect(qrl.url.encode('utf-8'))
 
 @require_http_methods(["GET", "POST"])
 def queue_enqueue(request, queue_name):