diff options
| author | alternativshik <alternativshik@gmail.com> | 2014-09-25 10:47:17 +0700 |
|---|---|---|
| committer | Dwayne Bailey <dwayne@translate.org.za> | 2015-02-24 11:53:47 +0000 |
| commit | 219f21b6378bbd66a13e997876c7c7416b27ef46 (patch) | |
| tree | 5a416cb7bd89805eff3f1c01b01358f2600263c0 /tests/test_job.py | |
| parent | dd75af92a4aaace5b29fb35af4e2ad4b6b57b273 (diff) | |
| download | rq-219f21b6378bbd66a13e997876c7c7416b27ef46.tar.gz | |
Allow non-ASCII characters in arguments
get_call_string() failed if any arguments contained non-ASCII strings.
Fixes #406
Diffstat (limited to 'tests/test_job.py')
| -rw-r--r-- | tests/test_job.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_job.py b/tests/test_job.py index e117ea9..d2e7f44 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -23,6 +23,26 @@ except ImportError: class TestJob(RQTestCase): + def test_unicode(self): + """Unicode in job description [issue405]""" + job = Job.create( + 'myfunc', + args=[12, "☃"], + kwargs=dict(snowman="☃", null=None), + ) + + try: + # Python 2 + test_string = u"myfunc(12, u'\\u2603', null=None, snowman=u'\\u2603')".decode('utf-8') + except AttributeError: + # Python 3 + test_string = "myfunc(12, '☃', null=None, snowman='☃')" + + self.assertEquals( + job.description, + test_string, + ) + def test_create_empty_job(self): """Creation of new empty jobs.""" job = Job() |
