diff --git a/src/wp-includes/block-template.php b/src/wp-includes/block-template.php
index de266c04f25..97ab4044ef0 100644
--- a/src/wp-includes/block-template.php
+++ b/src/wp-includes/block-template.php
@@ -46,6 +46,10 @@ function _add_template_loader_filters() {
  * @return string The path to the Full Site Editing template canvas file, or the fallback PHP template.
  */
 function locate_block_template( $template, $type, array $templates ) {
+	if ( ! current_theme_supports( 'block-templates' ) ) {
+		return $template;
+	}
+
 	global $_wp_current_template_content;
 
 	if ( $template ) {
diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php
index 95dab825b98..7163fea70ab 100644
--- a/tests/phpunit/tests/block-template.php
+++ b/tests/phpunit/tests/block-template.php
@@ -18,6 +18,7 @@ class Tests_Block_Template extends WP_UnitTestCase {
 	public function set_up() {
 		parent::set_up();
 		switch_theme( 'block-theme' );
+		do_action( 'setup_theme' );
 	}
 
 	public function tear_down() {
