def test_default_sort():
    (app, db, admin) = setup()
    (M1, _) = create_models(db)
    M1(test1='c').save()
    M1(test1='b').save()
    M1(test1='a').save()
    eq_(M1.objects.count(), 3)
    view = CustomModelView(M1, column_default_sort='test1')
    admin.add_view(view)
    (_, data) = view.get_list(0, None, None, None, None)
    eq_(data[0].test1, 'a')
    eq_(data[1].test1, 'b')
    eq_(data[2].test1, 'c')
def test_default_sort():
    (app, db, admin) = setup()
    (M1, _) = create_models(db)
    M1(test1='c').save()
    M1(test1='b').save()
    M1(test1='a').save()
    eq_(M1.objects.count(), 3)
    view = CustomModelView(M1, column_default_sort='test1')
    admin.add_view(view)
    (_, data) = view.get_list(0, None, None, None, None)
    eq_(data[0].test1, 'a')
    eq_(data[1].test1, 'b')
    eq_(data[2].test1, 'c')