@@ -69,11 +69,9 @@ def test_create_release_ticket_with_all_fields(self):
6969 args .project_name = 'TestProject'
7070 args .version = '1.2.3'
7171 args .short_description = 'Test release'
72- args .sq_compatibility = '2025.1'
7372 args .documentation_status = 'Ready'
7473 args .rule_props_changed = 'Yes'
7574 args .sonarlint_changelog = 'Test changelog'
76- args .targeted_product = '11.0'
7775
7876 release_url = 'https://jira.com/release/notes'
7977
@@ -88,42 +86,10 @@ def test_create_release_ticket_with_all_fields(self):
8886 self .assertEqual (call_args ['issuetype' ], 'Ask for release' )
8987 self .assertEqual (call_args ['summary' ], 'TestProject 1.2.3' )
9088 self .assertEqual (call_args ['customfield_10146' ], 'Test release' ) # SHORT_DESCRIPTION
91- self .assertEqual (call_args ['customfield_10148' ], '2025.1' ) # SQ_COMPATIBILITY
9289 self .assertEqual (call_args ['customfield_10145' ], release_url ) # LINK_TO_RELEASE_NOTES
9390 self .assertEqual (call_args ['customfield_10147' ], 'Ready' ) # DOCUMENTATION_STATUS
9491 self .assertEqual (call_args ['customfield_11263' ], {'value' : 'Yes' }) # RULE_PROPS_CHANGED
9592 self .assertEqual (call_args ['customfield_11264' ], 'Test changelog' ) # SONARLINT_CHANGELOG
96- self .assertEqual (call_args ['customfield_10163' ], {'value' : '11.0' }) # TARGETED_PRODUCT
97-
98- def test_create_release_ticket_without_optional_fields (self ):
99- """Test creating release ticket without optional fields."""
100- mock_jira = Mock ()
101- mock_ticket = Mock ()
102- mock_ticket .key = 'REL-124'
103- mock_ticket .permalink .return_value = 'https://jira.com/REL-124'
104- mock_jira .create_issue .return_value = mock_ticket
105-
106- # Mock args
107- args = Mock ()
108- args .project_name = 'TestProject'
109- args .version = '1.2.3'
110- args .short_description = 'Test release'
111- args .sq_compatibility = '2025.1'
112- args .documentation_status = 'N/A'
113- args .rule_props_changed = 'No'
114- args .sonarlint_changelog = ''
115- args .targeted_product = None
116-
117- release_url = 'https://jira.com/release/notes'
118-
119- result = create_release_ticket (mock_jira , args , release_url )
120-
121- self .assertEqual (result , mock_ticket )
122- mock_jira .create_issue .assert_called_once ()
123-
124- # Verify the issue creation call - should not include targeted_product
125- call_args = mock_jira .create_issue .call_args [1 ]['fields' ]
126- self .assertNotIn ('customfield_10163' , call_args ) # TARGETED_PRODUCT should not be set
12793
12894 # noinspection DuplicatedCode,PyUnusedLocal
12995 @patch ('create_release_ticket.eprint' )
@@ -138,11 +104,9 @@ def test_create_release_ticket_jira_error(self, mock_eprint):
138104 args .project_name = 'TestProject'
139105 args .version = '1.2.3'
140106 args .short_description = 'Test release'
141- args .sq_compatibility = '2025.1'
142107 args .documentation_status = 'N/A'
143108 args .rule_props_changed = 'No'
144109 args .sonarlint_changelog = ''
145- args .targeted_product = None
146110
147111 with self .assertRaises (SystemExit ) as cm :
148112 create_release_ticket (mock_jira , args , 'https://release.url' )
@@ -155,7 +119,6 @@ def test_create_release_ticket_jira_error(self, mock_eprint):
155119 '--project-name' , 'Test Project' ,
156120 '--version' , '1.0.0' ,
157121 '--short-description' , 'Test release' ,
158- '--sq-compatibility' , '2025.1' ,
159122 '--jira-url' , 'https://test.jira.com' ,
160123 '--jira-release-url' , 'https://jira.com/release/notes'
161124 ])
@@ -200,8 +163,6 @@ def test_main_successful_ticket_creation(self, mock_stderr, mock_stdout, mock_cr
200163 '--project-name' , 'Test Project' ,
201164 '--version' , '1.0.0' ,
202165 '--short-description' , 'Test release' ,
203- '--sq-compatibility' , '2025.1' ,
204- '--targeted-product' , '11.0' ,
205166 '--jira-url' , 'https://sandbox.jira.com' ,
206167 '--jira-release-url' , 'https://sandbox.jira.com/release/notes' ,
207168 '--documentation-status' , 'Ready' ,
@@ -235,8 +196,6 @@ def test_main_with_all_parameters(self, mock_stderr, mock_stdout, mock_create_ti
235196 self .assertEqual (args .project_name , 'Test Project' )
236197 self .assertEqual (args .version , '1.0.0' )
237198 self .assertEqual (args .short_description , 'Test release' )
238- self .assertEqual (args .sq_compatibility , '2025.1' )
239- self .assertEqual (args .targeted_product , '11.0' )
240199 self .assertEqual (args .jira_url , 'https://sandbox.jira.com' )
241200 self .assertEqual (args .jira_release_url , 'https://sandbox.jira.com/release/notes' )
242201 self .assertEqual (args .documentation_status , 'Ready' )
0 commit comments