Add regression test for user module code generation
Extract generating code to separate method