'CommandError is raised when using makemessages --add-location with
gettext < 0.19.'

@mock.patch('django.core.management.commands.makemessages.Command.gettext_version', new=(0, 18, 99))
def test_add_location_gettext_version_check(self):

    msg = 'The    --add-location    option    requires    gettext    0.19    or    later.    You    have    0.18.99.'
    with self.assertRaisesMessage(CommandError, msg):
        management.call_command('makemessages', locale=[LOCALE], verbosity=0, add_location='full')
