def test_division_suffix(self, mocker): description = mocker.PropertyMock(return_value="Foo Bar Division") mocker.patch.object(Post, "division_description", new=description) post = PostFactory.build() assert post.division_suffix == "division" description.assert_called_once()
def test_division_description(self, division_type, description): """ Test that for each division type choice, the correct description is returned """ post = PostFactory.build(division_type=division_type) assert post.division_description == description
def test_full_label(self, mocker): suffix = mocker.PropertyMock(return_value="ward") mocker.patch.object(Post, "division_suffix", new=suffix) post = PostFactory.build(label="Ecclesall") assert post.full_label == "Ecclesall ward" suffix.assert_called_once()