示例#1
0
    def store_transfer_usage(self, user_input):
        usages = transfer_usages_for_user(self.user)
        transfer_usage_map = list(
            map(KenyaUssdStateMachine.make_usage_mapping, usages))

        self.session.set_data('transfer_usage_mapping', transfer_usage_map)
        self.session.set_data('usage_menu', 0)
def test_transfer_usages_for_user(authed_sempo_admin_user):
    """
    GIVEN A User Model
    WHEN transfer_usages_for_user is called
    THEN a list is returned
    """
    # TODO This test in pretty lightweight atm it just checks if a list - also test if it sorts correctly:
    # first by highest count
    # then by defaults
    # then by everything else
    # can mock out relevant_usage call for a list
    usages = transfer_usages_for_user(authed_sempo_admin_user)
    assert isinstance(usages, list)