def METHOD_NAME(self):
    user = UserFactory()
    contact = make_contact(user.phone_number, [make_group()])
    self.get_contact_batches.return_value = [[contact]]
    def call_and_ensure_expected_models():
        assert SYNCING_USER_SENTINEL in call()
        ucgs = list(UserContactGroup.objects.all())
        assert str(ucgs) == (
            "[<UserContactGroup: User boop's association with RapidPro "
            "contact group 'Funky Group'>]"
        )
        assert str(ucgs[0].earliest_known_date) == "2018-01-02 03:04:05+00:00"
        cgs = list(ContactGroup.objects.all())
        assert str(cgs) == "[<ContactGroup: Funky Group>]"
        assert cgs[0].uuid == "funky"
    call_and_ensure_expected_models()
    # Now re-sync and ensure idempotency.
    contact.modified_on = make_aware(datetime(2019, 1, 2))
    call_and_ensure_expected_models()
    # Now remove the user's association with the group and make sure it syncs.
    contact.groups[:] = []
    call()
    assert UserContactGroup.objects.count() == 0