Allura/allura/tests/decorators.py
def audits(*messages, **kwargs):
    """
    Asserts all the messages exist in audit log

    :param messages: regex strings
    :param bool user: if this is a user log

    """
    M.AuditLog.query.remove()
    yield
    if kwargs.get('user'):
        actor = kwargs.get('actor', '.*')
        ip_addr = kwargs.get('ip_addr', '.*')
        preamble = '(Done by user: {}\n)?IP Address: {}\n'.format(actor, ip_addr)
    else:
        preamble = ''
    for message in messages:
        assert M.AuditLog.query.find(dict(
            message=re.compile(preamble + message))).count(), 'Could not find "%s"' % message

    Asserts all the messages exist in audit log

    :param messages: regex strings
    :param bool user: if this is a user log

    
Asserts all the messages exist in audit log
Asserts all the messages exist in audit log
def audits(*messages, **kwargs):
    M.AuditLog.query.remove()
    yield
    if kwargs.get('user'):
        actor = kwargs.get('actor', '.*')
        ip_addr = kwargs.get('ip_addr', '.*')
        preamble = '(Done by user: {}\n)?IP Address: {}\n'.format(actor, ip_addr)
    else:
        preamble = ''
    for message in messages:
        assert M.AuditLog.query.find(dict(
            message=re.compile(preamble + message))).count(), 'Could not find "%s"' % message
def audits ( * messages , ** kwargs ) : M . AuditLog . query . remove ( ) yield if kwargs . get ( 'user' ) : actor = kwargs . get ( 'actor' , '.*' ) ip_addr = kwargs . get ( 'ip_addr' , '.*' ) preamble = '(Done by user: {}\n)?IP Address: {}\n' . format ( actor , ip_addr ) else : preamble = '' for message in messages : assert M . AuditLog . query . find ( dict ( message = re . compile ( preamble + message ) ) ) . count ( ) , 'Could not find "%s"' % message
Asserts all the messages exist in audit log
Asserts all the messages exist in audit log
"""
    Asserts all the messages exist in audit log

    :param messages: regex strings
    :param bool user: if this is a user log

    """
messages
None
user
if this is a user log
if this is a user log