Merged in [10591] from housley@vigilsec.com:
Added a negative test to ensure the RFC Editor is not included on notifications of manual posts by the Secretariat unless the document is in the RFC Editor Queue.
Also added a directory for staging of manually submitted drafts, instead of using hardcoded /tmp/, and added creation and removal of a test directory for this.
- Legacy-Id: 10638
Note: SVN reference [10591] has been migrated to Git commit 4a2868cef5
This commit is contained in:
commit
8b12a0fa03
ietf
|
@ -26,9 +26,14 @@ class MainTestCase(TestCase):
|
|||
os.mkdir(self.archive_dir)
|
||||
settings.INTERNET_DRAFT_ARCHIVE_DIR = self.archive_dir
|
||||
|
||||
self.manual_dir = os.path.abspath("tmp-submit-manual-dir")
|
||||
os.mkdir(self.manual_dir)
|
||||
settings.IDSUBMIT_MANUAL_STAGING_DIR = self.manual_dir
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.repository_dir)
|
||||
shutil.rmtree(self.archive_dir)
|
||||
shutil.rmtree(self.manual_dir)
|
||||
|
||||
def test_abstract(self):
|
||||
draft = make_test_data()
|
||||
|
|
|
@ -69,7 +69,7 @@ def handle_uploaded_file(f):
|
|||
'''
|
||||
Save uploaded draft files to temporary directory
|
||||
'''
|
||||
destination = open(os.path.join('/tmp', f.name), 'wb+')
|
||||
destination = open(os.path.join(settings.IDSUBMIT_MANUAL_STAGING_DIR, f.name), 'wb+')
|
||||
for chunk in f.chunks():
|
||||
destination.write(chunk)
|
||||
destination.close()
|
||||
|
@ -155,7 +155,7 @@ def promote_files(draft, types):
|
|||
'''
|
||||
filename = '%s-%s' % (draft.name,draft.rev)
|
||||
for ext in types:
|
||||
path = os.path.join('/tmp', filename + ext)
|
||||
path = os.path.join(settings.IDSUBMIT_MANUAL_STAGING_DIR, filename + ext)
|
||||
shutil.move(path,settings.INTERNET_DRAFT_PATH)
|
||||
|
||||
# -------------------------------------------------
|
||||
|
|
|
@ -474,6 +474,9 @@ IDSUBMIT_STAGING_PATH = '/a/www/www6s/staging/'
|
|||
IDSUBMIT_STAGING_URL = '//www.ietf.org/staging/'
|
||||
IDSUBMIT_IDNITS_BINARY = '/a/www/ietf-datatracker/scripts/idnits'
|
||||
|
||||
IDSUBMIT_MANUAL_STAGING_DIR = '/tmp/'
|
||||
|
||||
|
||||
IDSUBMIT_FILE_TYPES = (
|
||||
'txt',
|
||||
'xml',
|
||||
|
|
Loading…
Reference in a new issue