def test_token_bad_ip_invalid(self):
     new = Token(data='127.0.0.1')
     new.save()
     assert not Token.pop(new.token, '255.255.255.0')
     assert Token.pop(new.token, '127.0.0.1')
 def test_token_fails(self):
     assert not Token.pop('some-random-token')
 def test_token_pop(self):
     new = Token()
     new.save()
     assert Token.pop(new.token)
     assert not Token.pop(new.token)
 def test_token_bad_ip_invalid(self):
     new = Token(data='127.0.0.1')
     new.save()
     assert not Token.pop(new.token, '255.255.255.0')
     assert Token.pop(new.token, '127.0.0.1')
 def test_token_fails(self):
     assert not Token.pop('some-random-token')
 def test_token_pop(self):
     new = Token()
     new.save()
     assert Token.pop(new.token)
     assert not Token.pop(new.token)