'Tests the CONTAINS operator works with the kwarg query method'

@execute_count(6)
def test_kwarg_success_case(self):

    q = IndexedCollectionsTestModel.filter(test_list__contains=1)
    self.assertEqual(q.count(), 2)
    q = IndexedCollectionsTestModel.filter(test_list__contains=13)
    self.assertEqual(q.count(), 0)
    q = IndexedCollectionsTestModel.filter(test_set__contains=3)
    self.assertEqual(q.count(), 2)
    q = IndexedCollectionsTestModel.filter(test_set__contains=13)
    self.assertEqual(q.count(), 0)
    q = IndexedCollectionsTestModel.filter(test_map__contains=42)
    self.assertEqual(q.count(), 1)
    q = IndexedCollectionsTestModel.filter(test_map__contains=13)
    self.assertEqual(q.count(), 0)
    with self.assertRaises(QueryException):
        q = IndexedCollectionsTestModel.filter(test_list_no_index__contains=1)
        self.assertEqual(q.count(), 0)
    with self.assertRaises(QueryException):
        q = IndexedCollectionsTestModel.filter(test_set_no_index__contains=1)
        self.assertEqual(q.count(), 0)
    with self.assertRaises(QueryException):
        q = IndexedCollectionsTestModel.filter(test_map_no_index__contains=1)
        self.assertEqual(q.count(), 0)
