本文整理汇总了Python中django.http.request.HttpRequest.POST['sampleLabel']方法的典型用法代码示例。如果您正苦于以下问题:Python HttpRequest.POST['sampleLabel']方法的具体用法?Python HttpRequest.POST['sampleLabel']怎么用?Python HttpRequest.POST['sampleLabel']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.http.request.HttpRequest
的用法示例。
在下文中一共展示了HttpRequest.POST['sampleLabel']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_upload_single_sample__unpaired
# 需要导入模块: from django.http.request import HttpRequest [as 别名]
# 或者: from django.http.request.HttpRequest import POST['sampleLabel'] [as 别名]
def test_upload_single_sample__unpaired(self):
project = self.common_entities['project']
request = HttpRequest()
request.POST = {
'projectUid': project.uid
}
request.method = 'POST'
request.user = self.common_entities['user']
authenticate(username=TEST_USERNAME, password=TEST_PASSWORD)
self.assertTrue(request.user.is_authenticated())
EXPERIMENT_SAMPLE_LABEL = 'my sample'
request.POST['sampleLabel'] = EXPERIMENT_SAMPLE_LABEL
request.FILES['fastq1'] = UploadedFile(
file=open(TEST_FQ1_FILE),
name='read1.fq')
response = upload_single_sample(request)
self.assertEqual(STATUS_CODE__SUCCESS, response.status_code)
self.assertFalse('error' in json.loads(response.content))
sample = ExperimentSample.objects.get(label=EXPERIMENT_SAMPLE_LABEL)
self.assertTrue(sample)
datasets = sample.dataset_set.all()
# num_datasets: 1 fastq + 1 fastqc = 2
self.assertEqual(2, len(datasets))
for dataset in datasets:
self.assertEqual(Dataset.STATUS.READY, dataset.status)