I'm sorry gentlemen but I think we were getting a little confused and off track here. Seems to be the norm lately.
Nanjing, bdickkahunna and Rander are all correct, I believe. And Shane is right in having a drink before entering this site these days.
The test pressure has nothing to do with the operating pressure or service conditions of the piping system per B31.3. It is based on the yield strength of the piping system. However when flanges are designed into the system, the flange rating becomes the limiting factor in pressure testing.
Therefore, if the designers use A106 Gr B pipe, for example, which let's say, for the sake of not arguing, has a yield strength of about 60,000 psi. I'm not sure if that is correct or not, and let's say they design 150# flanges into the system, which have a lower rating than the pipe, then the flanges become the limiting factor of that system for pressure testing. Same applies to valves.
If you have a 150# flange in a system and the test pressure is 30 bar per ANSI, then you test that system at 30 bar and not 90% of the yield strength of the pipe. The pipe can be tested seperately if so desired. Should be done at the mill anyway. Depends on the purchase order.
Now if you are installing API-6A or 6B flanges or valves then you have to consider the working pressure and base it on that.
However, the original question references B31.3, so ANSI would apply and not API, and if the 150# flange is welded on the spool piece the the test pressure would be 30bar, no matter what other flanges are installed. The intent of B31.3 is to test the pipe at 1.5x the design pressure, but they understand you can't overpressurize any part of the system and if 150# flanges are designed into it then the 1.5x the design pressure becomes useless.
Someone please correct me if I'm wrong. I'll be at the bar. Just have me paged.