def test_band_listing(self): instance = self._makeOne() self.session.add(instance) self.session.flush() # to get the id from the db from c3sar.models import Band result = Band.band_listing(order_by=None) #print "--- result: " + str(result) # [<c3sar.models.License object at 0x9fba10c>] #print "--- dir(result): " + str(dir(result)) # #print "--- license_listing: result.__len__(): " # + str(result.__len__()) # 1 self.assertEqual( result.__len__(), 1, "we expect the result list to have one entry")
def band_list(request): bands = Band.band_listing(Band.id.desc()) return {'bands': bands}