The requirement for the test will be depending on the country you are visiting and also the requirement made by the airlines. If you are travelling within the country, you are not required to get a test. You might need to do the test before or after reaching a foreign country.