class TestUser(object): def setup(self): self.u = User(name="Ben", mobile_number="447720149993") def teardown(self): pass def test_user_is_valid(self): assert self.u.validate()
def test_we_can_register_a_new_user(self): response = self.client.post("/register", data=json.dumps(dict(number="447720149993", name="Ben Hughes")), content_type="application/json") new_user = User(**response.json) self.assertTrue(new_user.validate())