Script: assign image texture to Image Texture node
The texture is not assigned because you are referring to it as a String instead of a data. Use the following code:

import bpy

# create blank image
bpy.ops.image.new(name="TestImg", width=1024, height=1024)

# get material reference
mat = bpy.context.view_layer.objects.active.active_material

# get texture reference
tex = bpy.data.images.get('TestImg')

# create node and assing the texture to it
image_node = mat.node_tree.nodes.new('ShaderNodeTexImage')
image_node.image = tex