Example from Wikipedia:
Suppose that in a particular geographic region, the mean and standard deviation of scores on a reading test are 100 points, and 12 points, respectively. Our interest is in the scores of 55 students in a particular school who received a mean score of 96. We can ask whether this mean score is significantly lower than the regional mean—that is, are the students in this school comparable to a simple random sample of 55 students from the region as a whole, or are their scores surprisingly low?
They further use population sigma as the standard deviation:
$\mathrm{SE} = \frac{\sigma}{\sqrt n} = \frac{12}{\sqrt{55}} = \frac{12}{7.42} = 1.62 \,\!$
This particular region may have higher variance in scores (for example, half of students are from poor families and have to work instead of studying). Why here (and in other text books) they assume variance as equal to population variance?
Another example: Example #2. We are OK when means of population and sample are different, but we do not let variances to be different. Also here you can see it directly. Is not it a misleading?
Yes, I know that we should use one sample t-test, and I am OK with calculation of variance using true known mean under $H_0$, but the question is about Z-test which is usually taught before t-test.
UPD Probable Answer: It seems that if you have population with $SD = x$ and you subsample from population with $SD != x$ - then your population is not normally distributed, but you have a mix of normal distributions (even if the means are the same). Correct me if I am wrong. Another problem that we do not care if population is normally distributed - we care that subsample is normally distributed (if we want to make Z-test stronger). But it is another story and have nothing in common with the assumptions of original Z test...
UPD: Wrong again. Assume we subsample guys who did not finish the school and have low scores in reading test.
scores <- rnorm(10000, mean=100, sd = 12)
region_scores <- scores[which(scores < 90)]
Distribution of region scores is not normal any more. We can not apply Z-test.
It seems that we can never apply the Z-test. Or, if we satisfy the test's assumptions and sample from the population randomly, we will have nothing interesting to test - our subsample will deviate in mean randomly, and no true effect will arise.
Test assumptions are described here. Why do they want to estimate deviation in means with random sampling from a normal population? There will be no true difference in means! I'm totally confused.