'Let\'s use a custom ModelAdmin that changes the ordering dinamically.'

def test_dynamic_ordering(self):

    super_user = User.objects.create(username=u'admin', is_superuser=True)
    other_user = User.objects.create(username=u'other')
    request = self.request_factory.get(u'/')
    request.user = super_user
    ma = DynOrderingBandAdmin(Band, None)
    names = [b.name for b in ma.get_queryset(request)]
    self.assertEqual([u'Radiohead', u'Van    Halen', u'Aerosmith'], names)
    request.user = other_user
    names = [b.name for b in ma.get_queryset(request)]
    self.assertEqual([u'Aerosmith', u'Radiohead', u'Van    Halen'], names)
