def METHOD_NAME(exp_singular, exp_plural, ret_singular, ret_plural):
    """Replace ngettext with a dummy implementation that returns
    predefined translations if given source text equals expected value
    and otherwise the source text unchanged.
    """
    original_ngettext = i18n.ngettext
    try:
        def dummy_ngettext(singular, plural, n):
            if n == 1 and singular == exp_singular:
                return ret_singular
            elif n != 1 and plural == exp_plural:
                return ret_plural
            else:
                return (singular if n == 1 else plural)
        i18n.ngettext = dummy_ngettext
        yield
    finally:
        i18n.ngettext = original_ngettext