Exemplo n.º 1
0
 def test_success(self, db):
     """Can join their own private channel."""
     p = factories.ProfileFactory.create()
     assert allow(p, "private-user_%s" % p.id)
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 def test_unknown_channel_type(self, db):
     """Unknown channel type is not authorized."""
     p = factories.ProfileFactory.create()
     assert not allow(p, "private-foo_1")
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def test_not_private(self, db):
     """Non-private channel can be joined by anyone."""
     p = factories.ProfileFactory.create()
     assert allow(p, "group_1234")
Exemplo n.º 6
0
 def test_success(self, db):
     """Can join their own private channel."""
     p = factories.ProfileFactory.create()
     assert allow(p, 'private-user_%s' % p.id)
Exemplo n.º 7
0
 def test_unknown_channel_type(self, db):
     """Unknown channel type is not authorized."""
     p = factories.ProfileFactory.create()
     assert not allow(p, 'private-foo_1')
Exemplo n.º 8
0
 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')
Exemplo n.º 9
0
 def test_not_private(self, db):
     """Non-private channel can be joined by anyone."""
     p = factories.ProfileFactory.create()
     assert allow(p, 'group_1234')
Exemplo n.º 10
0
 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)