Let G be a finite group. We say that G has a Johnson polynomial if there exists a polynomial f (x) ∈ Z[x] and a character χ ∈ Irr(G) so that f (χ) equals the total character for G. In this paper, we show that if G has nilpotence class 2, then G has a Johnson polynomial if and only if G is an extra-special 2-group. Generalizing this, we say that G has a generalized Johnson polynomial if f (x) ∈ Q[x]. We show that if G has nilpotence class 2, then G has a generalized Johnson polynomial if and only if Z(G) is cyclic. Also, if G is nilpotent and | cd(G)| = 2, then G has a generalized Johnson polynomial if and only if G has nilpotence class 2 and Z(G) is cyclic.