Example #1
0
 def setUp(self):
     self.app = app.test_client()
     self.csv_file = open(
         'test/test_data/sample/business-survey-sample-date.csv', 'rb')
     self.survey = {
         "id": "cb0711c3-0ac8-41d3-ae0e-567e5ea1ef87",
         "longName": "Business Register and Employment Survey",
         "shortName": "test",
         "surveyRef": "221"
     }
     self.collection_exercises = [{
         "id":
         "c6467711-21eb-4e78-804c-1db8392f93fb",
         "exerciseRef":
         "201601",
         "scheduledExecutionDateTime":
         "2017-05-15T00:00:00Z"
     }, {
         "id":
         "e33daf0e-6a27-40cd-98dc-c6231f50e84a",
         "exerciseRef":
         "000000",
         "scheduledExecutionDateTime":
         "2017-08-12T00:00:00Z"
     }]
     self.sample_summary = {
         "sampleSummaryPK": 1,
         "id": "08c191b8-e8b8-4920-b8de-87f85e536463",
         "state": "INIT",
         "ingestDateTime": "2017-11-06T14:02:24.203+0000"
     }
     self.linked_sample = {
         "collectionExerciseId": "e33daf0e-6a27-40cd-98dc-c6231f50e84a",
         "sampleSummaryIds": [self.sample_summary['id']]
     }
Example #2
0
 def setUp(self):
     self.app = app.test_client()
     self.headers = {
         'Content-Type': 'application/json',
     }
     self.survey = {
         "id": survey_id,
         "longName": "Business Register and Employment Survey",
         "shortName": "BRES",
         "surveyRef": "221"
     }
     self.collection_exercises = [{
         "id":
         "c6467711-21eb-4e78-804c-1db8392f93fb",
         "exerciseRef":
         "201601",
         "scheduledExecutionDateTime":
         "2017-05-15T00:00:00Z"
     }, {
         "id":
         collection_exercise_id,
         "exerciseRef":
         test_period,
         "scheduledExecutionDateTime":
         "2017-08-12T00:00:00Z"
     }]
     self.collection_instruments = [{
         "classifiers": {
             "COLLECTION_EXERCISE": [
                 collection_exercise_id,
             ],
             "RU_REF": [],
             "SURVEY_ID": survey_id,
         },
         "file_name": "file",
         "id": collection_instrument_id,
         "surveyId": survey_id
     }]
     self.eq_ci_selectors = [{
         "classifiers": {
             "COLLECTION_EXERCISE": [],
             "RU_REF": [],
             "SURVEY_ID": survey_id,
         },
         "file_name": None,
         "id": collection_instrument_id,
         "surveyId": survey_id
     }]
     self.sample_summary = {
         "sampleSummaryPK": 1,
         "id": sample_summary_id,
         "state": "INIT",
         "ingestDateTime": "2017-11-06T14:02:24.203+0000"
     }
     self.linked_sample = {
         "collectionExerciseId": collection_exercise_id,
         "sampleSummaryIds": [
             sample_summary_id,
         ]
     }
Example #3
0
    def setUp(self):
        # Changing log level to DEBUG
        loglevel = logging.DEBUG
        logging.basicConfig(level=loglevel)

        self.app = app.test_client()

        self.data = json.dumps({
            'username': '******',
            'password': '******',
        })

        self.wrong_user_data = json.dumps({
            'username': '******',
            'password': '******',
        })

        self.wrong_pass_data = json.dumps({
            'username': '******',
            'password': '******',
        })

        self.all_wrong_data = json.dumps({
            'username': '******',
            'password': '******',
        })

        self.headers = {
            'Content-Type': 'application/json',
        }
Example #4
0
 def setUp(self):
     self.app = app.test_client()
     self.valid_response = {
         "message": "A new verification email has been sent"
     }
     self.invalid_party_response = {
         "message": "There is no respondent with that party ID "
     }
Example #5
0
 def setUp(self):
     self.app = app.test_client()
     self.enrolment_details = {
         'respondent_id': 'test_id',
         'business_id': 'test_id',
         'survey_id': 'test_id',
         'change_flag': 'RESPONDENT_ENROLMENT_DISABLED'
     }
     self.headers = {
         'Content-Type': 'application/json',
     }
 def setUp(self):
     self.app = app.test_client()
     self.survey = {
         "id": 'cb0711c3-0ac8-41d3-ae0e-567e5ea1ef87',
         "longName": "Business Register and Employment Survey",
         "shortName": "BRES",
         "surveyRef": "221"
     }
     self.statuses = {
         "UPLOADED": "COMPLETE",
         "COMPLETEDBYPHONE": "COMPLETEDBYPHONE"
     }
    def setUp(self):
        self.app = app.test_client()
        self.headers = {
            'Content-Type': 'application/json',
        }
        self.survey = {
            "id": "cb0711c3-0ac8-41d3-ae0e-567e5ea1ef87",
            "longName": "Business Register and Employment Survey",
            "shortName": "BRES",
            "surveyRef": "221"
        }

        self.collection_exercises = [{
            "id":
            "c6467711-21eb-4e78-804c-1db8392f93fb",
            "name":
            "201601",
            "scheduledExecutionDateTime":
            "2017-05-15T00:00:00Z"
        }]

        self.collection_exercises_events = [{
            "id":
            "b4a36392-a21f-485b-9dc4-d151a8fcd565",
            "collectionExerciseId":
            "92d436aa-1251-4ae3-bad1-f3ae950f87be",
            "tag":
            "mps",
            "timestamp":
            "2018-03-16T00:00:00.000Z"
        }]

        self.collection_exercises_link = [
            "b9487b59-2ac7-4fbf-b734-5a4c260ff235"
        ]

        self.sample_summary = {
            "id": "b9487b59-2ac7-4fbf-b734-5a4c260ff235",
            "effectiveStartDateTime": "",
            "effectiveEndDateTime": "",
            "surveyRef": "",
            "ingestDateTime": "2018-03-14T14:29:51.325Z",
            "state": "ACTIVE",
            "totalSampleUnits": 5,
            "expectedCollectionInstruments": 1
        }
Example #8
0
 def setUp(self):
     self.app = app.test_client()
Example #9
0
 def setUp(self):
     self.app = app.test_client()
     self.headers = {
         'Content-Type': 'application/json',
     }