def METHOD_NAME(self):
    u"""
    Test that translation files are only generated when necessary.
    """
    self.build_js_translations()
    mtimes = {}
    for filename in os.listdir(self.temp_dir):
        fullname = os.path.join(self.temp_dir, filename)
        mtimes[filename] = os.path.getmtime(fullname)
    # Remove an output file and back-date another one
    removed_filename, outdated_filename = sorted(mtimes.keys())[:2]
    mtimes.pop(removed_filename)
    outdated_mtime = mtimes.pop(outdated_filename)
    os.remove(os.path.join(self.temp_dir, removed_filename))
    os.utime(os.path.join(self.temp_dir, outdated_filename), (0, 0))
    self.build_js_translations()
    # Make sure deleted file has been rebuild
    assert os.path.isfile(os.path.join(self.temp_dir, removed_filename))
    # Make sure outdated file has been rebuild
    fullname = os.path.join(self.temp_dir, outdated_filename)
    assert os.path.getmtime(fullname) >= outdated_mtime
    # Make sure the other files have not been rebuild
    for filename in os.listdir(self.temp_dir):
        if filename in [removed_filename, outdated_filename]:
            continue
        fullname = os.path.join(self.temp_dir, filename)
        new_mtime = os.path.getmtime(fullname)
        assert new_mtime == mtimes[filename]