def activate(obj, word='activate', url='registration_activate'):
    """
    For registered user get activation code from mailbox.
    """
    obj.assert_equal(len(mail.outbox), 1)

    body = mail.outbox[0].body
    match = re.search(word % '.*%s/(.*)', body)

    assert match, \
          'Failed to find proper activation link in the mail: %s' % body

    code = match.groups()[0]
    obj.go200(url, args=[code[:-1]])
dataset/ETHPy150Open playpauseandstop/tddspry/tddspry/django/helpers/registration.py/activate/swapped operands of `%`