Пример #1
0
 def test_sort_order_serialization_with_nested_path(self):
     sort_order = SortOrder('foo', mode='avg', nested_path='bar')
     self.assertEqual(sort_order.serialize(),
                      {'foo': {
                          'nested_path': 'bar',
                          'mode': 'avg'
                      }})
Пример #2
0
 def test_sort_order_serialization_with_nested_path(self):
     sort_order = SortOrder('foo', mode='avg', nested_path='bar')
     self.assertEqual(
         sort_order.serialize(),
         {'foo': {'nested_path': 'bar', 'mode': 'avg'}}
     )
Пример #3
0
 def test_sort_order_serialization_with_missing(self):
     sort_order = SortOrder('foo', missing='_last')
     self.assertEqual(sort_order.serialize(), {'foo': {'missing': '_last'}})
Пример #4
0
 def test_sort_order_serialization_with_order(self):
     sort_order = SortOrder('foo', 'asc')
     self.assertEqual(sort_order.serialize(), {'foo': {'order': 'asc'}})
Пример #5
0
 def test_sort_order_serialization(self):
     sort_order = SortOrder('foo')
     self.assertEqual(sort_order.serialize(), {'foo': {}})
Пример #6
0
 def test_sort_order_serialization_with_missing(self):
     sort_order = SortOrder('foo', missing='_last')
     self.assertEqual(sort_order.serialize(), {'foo': {'missing': '_last'}})
Пример #7
0
 def test_sort_order_serialization_with_order(self):
     sort_order = SortOrder('foo', 'asc')
     self.assertEqual(sort_order.serialize(), {'foo': {'order': 'asc'}})
Пример #8
0
 def test_sort_order_serialization(self):
     sort_order = SortOrder('foo')
     self.assertEqual(sort_order.serialize(), {'foo': {}})