Example #1
0
def test_feed_from_username():
    M.Feed(author_name='John Doe',
           author_link='/u/johndoe/',
           title='Something')
    M.Feed(author_name='John Smith',
           author_link='/u/johnsmith/',
           title='Something')
    ThreadLocalORMSession.flush_all()
    assert_equal(len(M.Feed.from_username('johndoe')), 1)
Example #2
0
def test_feed_clear_user_data():
    f = M.Feed(author_name='John Doe',
               author_link='/u/johndoe/',
               title='Something')
    f.clear_user_data()
    assert_equal(f.author_name, '')
    assert_equal(f.author_link, '')
    assert_equal(f.title, 'Something')

    f = M.Feed(author_name='John Doe',
               author_link='/u/johndoe/',
               title='Home Page modified by John Doe')
    f.clear_user_data()
    assert_equal(f.author_name, '')
    assert_equal(f.author_link, '')
    assert_equal(f.title, 'Home Page modified by <REDACTED>')