def test_transitions_list_two(self):
        """Retrieve two transitions."""

        transition_data = {
            'status': 'SUSPENDED',
            'reason_code': '00',
            'reason': 'They did bad things',
            'channel': 'FRAUD',
            'user_token': self.user.token
        }

        self.client.users(self.user.token).transitions.create(transition_data)

        transition_list = self.client.users(self.user.token).transitions.list()

        self.assertEqual(len(transition_list), 2,
                         'Transition list has incorrect number of entries')

        transition_one = transition_list[0]

        verify_user_transition(self, transition_one, transition_data)

        transition_two = transition_list[1]

        verify_user_transition(self, transition_two,
                               self.get_user_created_transition())
Exemple #2
0
    def test_transitions_create_closed(self):
        """Transition a user to closed."""

        self.transition_data['status'] = 'CLOSED'

        transition = self.client.users(
            self.user.token).transitions.create(self.transition_data)

        verify_user_transition(self, transition, self.transition_data)
Exemple #3
0
    def test_transitions_create_suspended(self):
        """Transition a user to suspended."""

        self.transition_data['status'] = 'SUSPENDED'

        transition = self.client.users(
            self.user.token).transitions.create(self.transition_data)

        verify_user_transition(self, transition, self.transition_data)
Exemple #4
0
    def test_transitions_create_active(self):
        """Transition a user to active."""

        self.transition_data['status'] = 'ACTIVE'

        transition = self.client.users(
            self.user.token).transitions.create(self.transition_data)

        verify_user_transition(self, transition, self.transition_data)
Exemple #5
0
    def test_transitions_create_unverified(self):
        """Transition a user to unverified."""

        self.transition_data['status'] = 'UNVERIFIED'

        transition = self.client.users(
            self.user.token).transitions.create(self.transition_data)

        verify_user_transition(self, transition, self.transition_data)
    def test_transitions_list_one(self):
        """Retrieve one transition."""

        transition_list = self.client.users(self.user.token).transitions.list()

        self.assertEqual(len(transition_list), 1,
                         'Transition list has incorrect number of entries')

        transition_one = transition_list[0]

        verify_user_transition(self, transition_one,
                               self.get_user_created_transition())
Exemple #7
0
    def test_transitions_find_exists(self):
        """Find a user transition that exists."""

        transition_data = {
            'status': 'UNVERIFIED',
            'reason_code': '00',
            'reason': 'Testing',
            'channel': 'SYSTEM',
            'user_token': self.user.token
        }

        transition = self.client.users(
            self.user.token).transitions.create(transition_data)

        found_transition = self.client.users(self.user.token).transitions.find(
            transition.token)

        verify_user_transition(self, found_transition, transition_data)