'Tests to make sure nested collection type validation occurs
@since 3.1
@jira_ticket PYTHON-478
@expected_result validation errors are raised
@test_category object_mapper'

def test_type_validation(self):

    list_list_bad_list_context = [['text', 'text', 'text'], ['text', 'text', 'text'], ['text', 'text', 'text']]
    list_list_no_list = ['text', 'text', 'text']
    map_list_bad_value = {'key1': [1, 2, 3], 'key2': [1, 2, 3], 'key3': [1, 2, 3]}
    map_list_bad_key = {1: ['text1', 'text2', 'text3'], 2: ['text1', 'text2', 'text3'], 3: ['text1', 'text2', 'text3']}
    set_tuple_bad_tuple_value = set((('text', 'text'), ('text', 'text'), ('text', 'text')))
    set_tuple_not_set = ['This', 'is', 'not', 'a', 'set']
    self.assertRaises(ValidationError, TestNestedModel.create, **{'list_list': list_list_bad_list_context})
    self.assertRaises(ValidationError, TestNestedModel.create, **{'list_list': list_list_no_list})
    self.assertRaises(ValidationError, TestNestedModel.create, **{'map_list': map_list_bad_value})
    self.assertRaises(ValidationError, TestNestedModel.create, **{'map_list': map_list_bad_key})
    self.assertRaises(ValidationError, TestNestedModel.create, **{'set_tuple': set_tuple_bad_tuple_value})
    self.assertRaises(ValidationError, TestNestedModel.create, **{'set_tuple': set_tuple_not_set})
