'Ensure that ListField works with standard list operators that
do lexigraphic ordering.'

def test_list_field_lexicographic_operators(self):

    class BlogPost(Document, ):
        ref = StringField()
        text_info = ListField(StringField())
        oid_info = ListField(ObjectIdField())
        bool_info = ListField(BooleanField())
    BlogPost.drop_collection()
    blogSmall = BlogPost(ref='small')
    blogSmall.text_info = ['a', 'a', 'a']
    blogSmall.bool_info = [False, False]
    blogSmall.save()
    blogSmall.reload()
    blogLargeA = BlogPost(ref='big')
    blogLargeA.text_info = ['a', 'z', 'j']
    blogLargeA.bool_info = [False, True]
    blogLargeA.save()
    blogLargeA.reload()
    blogLargeB = BlogPost(ref='big2')
    blogLargeB.text_info = ['a', 'z', 'j']
    blogLargeB.oid_info = ['54495ad94c934721ede76f90', '54495ad94c934721ede76d23', '54495ad94c934721ede76d00']
    blogLargeB.bool_info = [False, True]
    blogLargeB.save()
    blogLargeB.reload()
    self.assertEqual(blogLargeA.text_info, blogLargeB.text_info)
    self.assertEqual(blogLargeA.bool_info, blogLargeB.bool_info)
    self.assertGreaterEqual(blogLargeA.text_info, blogSmall.text_info)
    self.assertGreaterEqual(blogLargeA.text_info, blogLargeB.text_info)
    self.assertGreaterEqual(blogLargeA.bool_info, blogSmall.bool_info)
    self.assertGreaterEqual(blogLargeA.bool_info, blogLargeB.bool_info)
    self.assertGreaterEqual(blogLargeA.text_info, blogSmall.text_info)
    self.assertGreaterEqual(blogLargeA.bool_info, blogSmall.bool_info)
    self.assertLessEqual(blogSmall.text_info, blogLargeB.text_info)
    self.assertLessEqual(blogLargeA.text_info, blogLargeB.text_info)
    self.assertLessEqual(blogSmall.bool_info, blogLargeB.bool_info)
    self.assertLessEqual(blogLargeA.bool_info, blogLargeB.bool_info)
    self.assertLess(blogSmall.text_info, blogLargeB.text_info)
    self.assertLess(blogSmall.bool_info, blogLargeB.bool_info)
    self.assertNotEqual(blogSmall.text_info, blogLargeB.text_info)
    self.assertNotEqual(blogSmall.bool_info, blogLargeB.bool_info)
    blogLargeB.bool_info = [True, False, True, False]
    blogLargeB.text_info.sort()
    blogLargeB.oid_info.sort()
    blogLargeB.bool_info.sort()
    sorted_target_list = [ObjectId('54495ad94c934721ede76d00'), ObjectId('54495ad94c934721ede76d23'), ObjectId('54495ad94c934721ede76f90')]
    self.assertEqual(blogLargeB.text_info, ['a', 'j', 'z'])
    self.assertEqual(blogLargeB.oid_info, sorted_target_list)
    self.assertEqual(blogLargeB.bool_info, [False, False, True, True])
    blogLargeB.save()
    blogLargeB.reload()
    self.assertEqual(blogLargeB.text_info, ['a', 'j', 'z'])
    self.assertEqual(blogLargeB.oid_info, sorted_target_list)
    self.assertEqual(blogLargeB.bool_info, [False, False, True, True])
