Example #1
0
    def test_unpair(self):
        """QRToken unittest: checking if unpairing works"""

        fake = FakeTokenModel()

        token = QrTokenClass(fake)

        token.addToTokenInfo("user_token_id", "bar")
        token.addToTokenInfo("user_public_key", "foo")
        token.change_state("baz")

        token.unpair()

        assert "user_token_id" not in fake.info_dict
        assert "user_public_key" not in fake.info_dict
        assert "pairing_url_sent" == token.current_state
Example #2
0
    def test_unpair(self):
        """ QRToken unittest: checking if unpairing works """

        fake = FakeTokenModel()

        token = QrTokenClass(fake)

        token.addToTokenInfo('user_token_id', 'bar')
        token.addToTokenInfo('user_public_key', 'foo')
        token.change_state('baz')

        token.unpair()

        self.assertNotIn('user_token_id', fake.info_dict)
        self.assertNotIn('user_public_key', fake.info_dict)
        self.assertEqual('pairing_url_sent', token.current_state)
Example #3
0
    def test_unpair(self):

        """ QRToken unittest: checking if unpairing works """

        fake = FakeTokenModel()

        token = QrTokenClass(fake)

        token.addToTokenInfo('user_token_id', 'bar')
        token.addToTokenInfo('user_public_key', 'foo')
        token.change_state('baz')

        token.unpair()

        self.assertNotIn('user_token_id', fake.info_dict)
        self.assertNotIn('user_public_key', fake.info_dict)
        self.assertEqual('pairing_url_sent', token.current_state)