def METHOD_NAME(project_a, project_b, locale_a):
    """
    Project.needs_sync should be True if ChangedEntityLocale objects
    exist for its entities or if Project has unsynced locales.
    """
    resource = ResourceFactory.create(project=project_a, path="resourceX.po")
    entity = EntityFactory.create(resource=resource, string="entityX")
    assert not project_a.needs_sync
    ChangedEntityLocaleFactory.create(entity=entity, locale=locale_a)
    assert project_a.needs_sync
    assert not project_b.needs_sync
    assert project_b.unsynced_locales == []
    del project_b.unsynced_locales
    ProjectLocaleFactory.create(
        project=project_b,
        locale=locale_a,
    )
    assert project_b.needs_sync == [locale_a]