コード例 #1
0
    def test_user_with_no_perms(self):
        u = User(passwordhash='123')
        f = Feed()

        u.save()
        f.save()

        self.assertEqual(u.writeable_feeds(), [])
コード例 #2
0
    def test_user_with_no_perms(self):
        u = User(passwordhash='123')
        f = Feed()

        u.save()
        f.save()

        self.assertEqual(u.writeable_feeds(), [])
コード例 #3
0
    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])
コード例 #4
0
    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])
コード例 #5
0
    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])
コード例 #6
0
    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])