Maximum entropy based testing in network models: ERGMs and constrained optimization