def get_to_pay(energy_value_id, request=None): value = EnergyValue.get(energy_value_id) member = value.member allotments = '/'.join(str(a.number) for a in member.allotments) if not allotments: allotments = 'n/a' return '{} ({}, {})'.format(allotments, member.lastname, member.firstname)
def test_value_has_a_member(database): from sw.allotmentclub import EnergyValue, Member setUp() value = EnergyValue.get(1) assert Member.get(1) == value.member