Esempio 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)
Esempio 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")
Esempio 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")
Esempio 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)
Esempio 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")
Esempio 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)
Esempio 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')
Esempio 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')
Esempio 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')
Esempio 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)