Ignore:
Timestamp:
12 Feb 2011, 14:47:57 (14 years ago)
Author:
uli
Message:

Add doctest for getName.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py

    r5734 r5736  
    9595def getName(context):
    9696    """Construct a name out of an object with prefix and title.
     97
     98    The `context` has to provide `title_prefix` and `title`
     99    attributes.
     100
     101        >>> from waeup.sirp.utils.helpers import getName
     102        >>> class FakeObject(object):
     103        ...     title_prefix = 'department'
     104        ...     title = 'Strange Things'
     105        >>> getName(FakeObject())
     106        'Department of Strange Things'
     107
     108    As we can see in the result the `title_prefix` is rendered
     109    uppercase.
     110       
    97111    """
    98112    prefix = context.title_prefix
Note: See TracChangeset for help on using the changeset viewer.