Skip to content

Commit

Permalink
Add tests for #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Harling committed Dec 13, 2016
1 parent eb19706 commit b6ba30b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/fixtures/custom_fields_utf8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
***REMOVED***{
***REMOVED******REMOVED***"FieldName": "salary_range",
***REMOVED******REMOVED***"Key": "[]",
***REMOVED******REMOVED***"DataType": "MultiSelectOne",
***REMOVED******REMOVED***"FieldOptions": ["£0-20k", "£20-30k", "£30k+"],
***REMOVED******REMOVED***"VisibleInPreferenceCenter": true
***REMOVED***},
***REMOVED***{
***REMOVED******REMOVED***"FieldName": "age",
***REMOVED******REMOVED***"Key": "[age]",
***REMOVED******REMOVED***"DataType": "Number",
***REMOVED******REMOVED***"FieldOptions": [],
***REMOVED******REMOVED***"VisibleInPreferenceCenter": true
***REMOVED***}
]
10 changes: 10 additions & 0 deletions test/test_list.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

from six.moves.urllib.parse import quote
import unittest

Expand Down Expand Up @@ -88,6 +90,14 @@ class ListTestCase(object):
***REMOVED******REMOVED***self.assertEquals(cfs[0].DataType, "Text")
***REMOVED******REMOVED***self.assertEquals(cfs[0].FieldOptions, [])
***REMOVED******REMOVED***self.assertEquals(cfs[0].VisibleInPreferenceCenter, True)
***REMOVED***
***REMOVED***def test_custom_fields_utf8(self):
***REMOVED******REMOVED***self.list.stub_request("lists/%s/customfields.json" % self.list.list_id, "custom_fields_utf8.json")
***REMOVED******REMOVED***cfs = self.list.custom_fields()
***REMOVED******REMOVED***self.assertEquals(len(cfs), 2)
***REMOVED******REMOVED***self.assertEquals(cfs[0].FieldName, "salary_range")
***REMOVED******REMOVED***self.assertEquals(cfs[0].FieldOptions, [u"£0-20k", u"£20-30k", u"£30k+"])


***REMOVED***def test_segments(self):
***REMOVED******REMOVED***self.list.stub_request("lists/%s/segments.json" % self.list.list_id, "segments.json")
Expand Down

0 comments on commit b6ba30b

Please sign in to comment.