Esempio n. 1
0
    def test_not_logged_in_fail(self):
        """ check_crosswalk - User not logged in """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = AnonymousUser()

        result = check_crosswalk(request)

        # print("Result:%s" % result)

        self.assertEqual(result.status_code, 302)
    def test_not_logged_in_fail(self):
        """ check_crosswalk - User not logged in """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = AnonymousUser()

        result = check_crosswalk(request)

        # print("Result:%s" % result)

        self.assertEqual(result.status_code,
                         302)
    def test_user_logged_in_no_crosswalk(self):
        """ check_crosswalk - User Logged in. No Entry in xwalk """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = self.user

        result = check_crosswalk(request)

        # print("No Crosswalk Result:%s" % result.content)

        self.assertContains(result,
                            'Paste the contents of a Blue Button Text File',
                            count=None, status_code=200)
Esempio n. 4
0
    def test_user_logged_in_no_crosswalk(self):
        """ check_crosswalk - User Logged in. No Entry in xwalk """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = self.user

        result = check_crosswalk(request)

        # print("No Crosswalk Result:%s" % result.content)

        self.assertContains(result,
                            'Paste the contents of a Blue Button Text File',
                            count=None,
                            status_code=200)
    def test_user_logged_in_crosswalk_no_fhir_id(self):
        """ check_crosswalk - User Logged in. Entry in xwalk. No fhir_id """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = self.user
        request.messages = self.messages
        # setattr(request, 'session', 'session')
        # messages = FallbackStorage(request)
        # setattr(request, '_messages', messages)

        xwalk = Crosswalk()
        xwalk.user = request.user
        xwalk.save()

        result = check_crosswalk(request)

        # print("Crosswalk found Result:%s" % result.content)

        self.assertContains(result,
                            'Paste the contents of a Blue Button Text File',
                            count=None, status_code=200)
Esempio n. 6
0
    def test_user_logged_in_crosswalk_no_fhir_id(self):
        """ check_crosswalk - User Logged in. Entry in xwalk. No fhir_id """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = self.user
        request.messages = self.messages
        # setattr(request, 'session', 'session')
        # messages = FallbackStorage(request)
        # setattr(request, '_messages', messages)

        xwalk = Crosswalk()
        xwalk.user = request.user
        xwalk.save()

        result = check_crosswalk(request)

        # print("Crosswalk found Result:%s" % result.content)

        self.assertContains(result,
                            'Paste the contents of a Blue Button Text File',
                            count=None,
                            status_code=200)
    def test_user_logged_in_crosswalk_fhir_id(self):
        """ check_crosswalk - User Logged in. Entry in xwalk with FHIR_ID """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = self.user
        request._messages = FakeMessages()
        # setattr(request, 'session', 'session')
        # request.messages = self.messages
        # setattr(request, '_messages', messages)

        xwalk = Crosswalk()
        xwalk.user = self.user
        xwalk.fhir_id = "12345678"
        xwalk.save()

        expected = 'Account is already linked to a FHIR resource.'

        result = check_crosswalk(request)
        result = result

        # print("Crosswalk found "
        #       "with FHIR ID Result:%s" % request._messages.pop)

        self.assertEqual(request._messages.pop, expected)
Esempio n. 8
0
    def test_user_logged_in_crosswalk_fhir_id(self):
        """ check_crosswalk - User Logged in. Entry in xwalk with FHIR_ID """

        request = self.factory.get('/create_test_account/bb_upload/')
        request.user = self.user
        request._messages = FakeMessages()
        # setattr(request, 'session', 'session')
        # request.messages = self.messages
        # setattr(request, '_messages', messages)

        xwalk = Crosswalk()
        xwalk.user = self.user
        xwalk.fhir_id = "12345678"
        xwalk.save()

        expected = 'Account is already linked to a FHIR resource.'

        result = check_crosswalk(request)
        result = result

        # print("Crosswalk found "
        #       "with FHIR ID Result:%s" % request._messages.pop)

        self.assertEqual(request._messages.pop, expected)