def test_ordering():
 app1id = app_factory().id
 app2id = app_factory().id
 app3id = app_factory().id
 semi_arbitrary_order = [app2id, app3id, app1id]
 addons = manual_order(Webapp.objects.all(), semi_arbitrary_order)
 eq_(semi_arbitrary_order, [addon.id for addon in addons])

def test_ordering ( ) : app1id = app_factory ( ) . id app2id = app_factory ( ) . id app3id = app_factory ( ) . id semi_arbitrary_order = [ app2id , app3id , app1id ] addons = manual_order ( Webapp . objects . all ( ) , semi_arbitrary_order ) eq_ ( semi_arbitrary_order , [ addon . id for addon in addons ] )
given a specific set of primary keys .