def test_rss_campaign():
    """ add, pause, resume rss campaign """

    uid = md5.new(str(random.random())).hexdigest()
    subject = uid % 'chimpy campaign rss test %s'
    options = {'list_id': list_id(),
           'subject': subject,
           'from_email': EMAIL_ADDRESS,
           'from_name': 'chimpy',
           'generate_text': True
           }

    html = """ <html><body><h1>My test RSS newsletter</h1><p>Just testing</p>
               <a href="*|UNSUB|*">Unsubscribe</a>*|REWARDS|*</body>"""


    content = {'html': html}
    type_opts = {'url': 'http://mailchimp.com/blog/rss'}

    cid = chimp.campaign_create('rss', options, content, type_opts=type_opts)
    campaign = chimp.campaigns(filter_subject=subject)['data'][0]
    assert campaign['type'] == 'rss'

    # Todo: Could not find a way to activate the RSS from the API. You need to
    # activate before being able to test pause and resume. send_now and schedule
    # didn't do the trick.

    #chimp.campaign_pause(cid)
    #chimp.campaign_resume(cid)

    #clean up
    chimp.campaign_delete(cid)
dataset/ETHPy150Open divio/django-mailchimp/mailchimp/chimpy/test_chimpy.py/test_rss_campaign/swapped operands of `%`