def __create_bookmark(self, url, username): """Helper that creates a bookmark object with a random tag""" b = Bmark( url=url, username=username ) tagname = gen_random_word(5) b.tags[tagname] = Tag(tagname) return b
def test_total_ct(self): """Verify that our total count method is working""" ct = 5 for i in range(ct): t = Tag(gen_random_word(10)) DBSession.add(t) ct = TagMgr.count() eq_(5, ct, 'We should have a total of 5: ' + str(ct))
def make_tag(name=None): if not name: name = random_string(255) return Tag(name)