What is the formula for calculating the test statistic for a one-sample z test?

Is it one-population z test? Because we cannot have one sample only in stat experiments. In z test, it is preferable to have n>= 30. We have the formula, z= (computed mean – hypothesized mean) divided by the standard error. SE(standard error) = standard deviation/n.