
    P1i                     >    d dl mZ d dlmZ d dlmZ  G d de      Zy)    )BaseCommand)
get_runner)settingsc                       e Zd ZdZd Zd Zy)Commandz\Run YBP (Yellow/Black Path) view tests to verify correct classification of good and bad godsc                 ,    |j                  ddd       y )Nz	--verbose
store_truezVerbose output)actionhelp)add_argument)selfparsers     L/home/cursorai/projects/iching/tongshu/management/commands/test_ybp_views.pyadd_argumentszCommand.add_arguments	   s    ! 	 	
    c                    | j                   j                  | j                  j                  d             t	        t
              } ||d   rdnd      }|j                  dg      }|r9| j                   j                  | j                  j                  d| d             y	| j                   j                  | j                  j                  d
             | j                   j                  d       | j                   j                  d       | j                   j                  d       | j                   j                  d       | j                   j                  d       | j                   j                  d       y	)zRun the YBP view tests.z-Running YBP (Yellow/Black Path) view tests...verbose      )	verbosityz%tongshu.tests.TongshuYBPViewsTestCasezTests failed! z failure(s)Nu   ✅ All YBP view tests passed! zThese tests verify that:u_   • Good gods (黄道): 青龙, 明堂, 金匮, 天德, 玉堂, 司命 → classified as "good"u]   • Bad gods (黑道): 天刑, 朱雀, 白虎, 天牢, 玄武, 勾陈 → classified as "bad"u-   • View functions return consistent YBP datau9   • Month view template receives properly classified data)stdoutwritestyleSUCCESSr   r   	run_testsERROR)r   argsoptions
TestRunnertest_runnerfailuress         r   handlezCommand.handle   s+    	JJNO	

  )
 	0B1J ((*Q)RSKK

  >(;!GH JJ?@	
 	"45{|yzIJUVr   N)__name__
__module____qualname__r   r   r#    r   r   r   r      s    iD
Wr   r   N)django.core.management.baser   django.test.utilsr   django.confr   r   r'   r   r   <module>r+      s    3 (  &Wk &Wr   