def test_user_with_no_perms(self): u = User(passwordhash='123') f = Feed() u.save() f.save() self.assertEqual(u.writeable_feeds(), [])
def test_user_with_one_feed(self): u = User(passwordhash='123') f = Feed() u.save() f.save() f.grant('Write', user=u) self.assertEqual(u.writeable_feeds(), [f])
def test_user_with_one_feed_via_group(self): u = User(passwordhash='123') g = Group(name='group_with_a_name') f = Feed() u.save() f.save() g.save() g.set_users([u.id]) f.grant('Write', group=g) self.assertEqual(u.writeable_feeds(), [f])