Пример #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)
Пример #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")
Пример #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")
Пример #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)
Пример #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")
Пример #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)
Пример #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')
Пример #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')
Пример #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')
Пример #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)