def test_allocate(self): self.client.call = Mock(return_value=1) assert User.allocate(self.client, 'jon', 'secret') == 1