diff options
Diffstat (limited to 'tests/test_pandora/test_models.py')
-rw-r--r-- | tests/test_pandora/test_models.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_pandora/test_models.py b/tests/test_pandora/test_models.py index ce71ef8..410b0de 100644 --- a/tests/test_pandora/test_models.py +++ b/tests/test_pandora/test_models.py | |||
@@ -52,6 +52,39 @@ class TestDateField(TestCase): | |||
52 | self.assertEqual(expected, model.date_field.replace(microsecond=0)) | 52 | self.assertEqual(expected, model.date_field.replace(microsecond=0)) |
53 | 53 | ||
54 | 54 | ||
55 | class TestAdditionalUrlField(TestCase): | ||
56 | |||
57 | def test_single_url(self): | ||
58 | dummy_data = { | ||
59 | '_paramAdditionalUrls': ['foo'] | ||
60 | } | ||
61 | |||
62 | field = pm.AdditionalUrlField("additionalAudioUrl") | ||
63 | |||
64 | ret = field.formatter(None, dummy_data, 'test') | ||
65 | |||
66 | self.assertEqual(ret, {'foo': 'test'}) | ||
67 | |||
68 | def test_multiple_urls(self): | ||
69 | dummy_data = { | ||
70 | '_paramAdditionalUrls': [ | ||
71 | 'abc', | ||
72 | 'def', | ||
73 | ] | ||
74 | } | ||
75 | |||
76 | field = pm.AdditionalUrlField("additionalAudioUrl") | ||
77 | |||
78 | ret = field.formatter(None, dummy_data, ['foo', 'bar']) | ||
79 | |||
80 | expected = { | ||
81 | 'abc': 'foo', | ||
82 | 'def': 'bar', | ||
83 | } | ||
84 | |||
85 | self.assertEqual(ret, expected) | ||
86 | |||
87 | |||
55 | class TestPandoraModel(TestCase): | 88 | class TestPandoraModel(TestCase): |
56 | 89 | ||
57 | JSON_DATA = { | 90 | JSON_DATA = { |