@@ -597,6 +597,29 @@ def test_update_draft_auth48_url(self):
597597 auth48_docurl = draft .documenturl_set .filter (tag_id = 'auth48' ).first ()
598598 self .assertIsNone (auth48_docurl )
599599
600+ def test_post_approved_draft_in_production_only (self ):
601+ self .requests_mock .post ("https://rfceditor.example.com/" , status_code = 200 , text = "OK" )
602+
603+ # be careful playing with SERVER_MODE!
604+ with override_settings (SERVER_MODE = "test" ):
605+ self .assertEqual (
606+ rfceditor .post_approved_draft ("https://rfceditor.example.com/" , "some-draft" ),
607+ ("" , "" )
608+ )
609+ self .assertFalse (self .requests_mock .called )
610+ with override_settings (SERVER_MODE = "development" ):
611+ self .assertEqual (
612+ rfceditor .post_approved_draft ("https://rfceditor.example.com/" , "some-draft" ),
613+ ("" , "" )
614+ )
615+ self .assertFalse (self .requests_mock .called )
616+ with override_settings (SERVER_MODE = "production" ):
617+ self .assertEqual (
618+ rfceditor .post_approved_draft ("https://rfceditor.example.com/" , "some-draft" ),
619+ ("" , "" )
620+ )
621+ self .assertTrue (self .requests_mock .called )
622+
600623
601624class DiscrepanciesTests (TestCase ):
602625 def test_discrepancies (self ):
@@ -636,6 +659,7 @@ def test_discrepancies(self):
636659 r = self .client .get (urlreverse ("ietf.sync.views.discrepancies" ))
637660 self .assertContains (r , doc .name )
638661
662+
639663class RFCEditorUndoTests (TestCase ):
640664 def test_rfceditor_undo (self ):
641665 draft = WgDraftFactory ()
0 commit comments