コード例 #1
0
 def test_user_can_be_loaded_from_session_token(self):
     self.make_participant('alice')
     token = User.from_id('alice').session_token
     actual = User.from_session_token(token).id
     assert actual == 'alice', actual
コード例 #2
0
 def test_signed_out_user_is_anonymous(self):
     self.make_participant('alice')
     alice = User.from_id('alice')
     assert not alice.ANON
     alice = alice.sign_out()
     assert alice.ANON
コード例 #3
0
 def test_user_from_bad_id_is_anonymous(self):
     user = User.from_id('deadbeef')
     assert user.ANON
コード例 #4
0
 def test_suspicious_user_from_id_is_anonymous(self):
     self.make_participant('alice', is_suspicious=True)
     user = User.from_id('alice')
     assert user.ANON
コード例 #5
0
 def test_known_user_is_not_admin(self):
     self.make_participant('alice')
     alice = User.from_id('alice')
     assert not alice.ADMIN
コード例 #6
0
 def test_admin_user_is_admin(self):
     self.make_participant('alice', is_admin=True)
     alice = User.from_id('alice')
     assert alice.ADMIN
コード例 #7
0
 def test_signed_out_user_is_anonymous(self):
     self.make_participant('alice')
     alice = User.from_id('alice')
     assert not alice.ANON
     alice = alice.sign_out()
     assert alice.ANON
コード例 #8
0
 def test_known_user_is_known(self):
     self.make_participant("alice")
     alice = User.from_id("alice")
     assert not alice.ANON
コード例 #9
0
 def test_user_can_be_loaded_from_session_token(self):
     self.make_participant('alice')
     token = User.from_id('alice').session_token
     actual = User.from_session_token(token).id
     assert actual == 'alice', actual
コード例 #10
0
 def test_suspicious_user_from_id_is_anonymous(self):
     self.make_participant('alice', is_suspicious=True)
     user = User.from_id('alice')
     assert user.ANON
コード例 #11
0
 def test_user_from_bad_id_is_anonymous(self):
     user = User.from_id('deadbeef')
     assert user.ANON
コード例 #12
0
 def test_admin_user_is_admin(self):
     self.make_participant('alice', is_admin=True)
     alice = User.from_id('alice')
     assert alice.ADMIN
コード例 #13
0
 def test_known_user_is_not_admin(self):
     self.make_participant('alice')
     alice = User.from_id('alice')
     assert not alice.ADMIN