def test_success(self, db): """Can join their own private channel.""" p = factories.ProfileFactory.create() assert allow(p, "private-user_%s" % p.id)
def test_bad_channel_id(self, db): """Last part of channel name must be integer ID.""" p = factories.ProfileFactory.create() assert not allow(p, "private-group_foo")
def test_unknown_channel_type(self, db): """Unknown channel type is not authorized.""" p = factories.ProfileFactory.create() assert not allow(p, "private-foo_1")
def test_failure(self, db): """Cannot join someone else's private channel.""" p1 = factories.ProfileFactory.create() p2 = factories.ProfileFactory.create() assert not allow(p1, "private-user_%s" % p2.id)
def test_not_private(self, db): """Non-private channel can be joined by anyone.""" p = factories.ProfileFactory.create() assert allow(p, "group_1234")
def test_success(self, db): """Can join their own private channel.""" p = factories.ProfileFactory.create() assert allow(p, 'private-user_%s' % p.id)
def test_unknown_channel_type(self, db): """Unknown channel type is not authorized.""" p = factories.ProfileFactory.create() assert not allow(p, 'private-foo_1')
def test_bad_channel_id(self, db): """Last part of channel name must be integer ID.""" p = factories.ProfileFactory.create() assert not allow(p, 'private-group_foo')
def test_not_private(self, db): """Non-private channel can be joined by anyone.""" p = factories.ProfileFactory.create() assert allow(p, 'group_1234')
def test_failure(self, db): """Cannot join someone else's private channel.""" p1 = factories.ProfileFactory.create() p2 = factories.ProfileFactory.create() assert not allow(p1, 'private-user_%s' % p2.id)