def test_request_added(self):
        data = {
            'recaptcha_response_field': 'PASSED',  # to auto-pass RECAPTCHA
            'personal': 'Harry', 'family': 'Potter',
            'email': 'harry@potter.com', 'airport_iata': 'LON',
            'affiliation': 'Auror at Ministry of Magic',
            'occupation': '', 'occupation_other': 'Auror',
            'github': 'hpotter', 'twitter': 'hpotter',
            'orcid': '', 'website': '', 'gender': 'M',
            'domains': [1, 2],  # IDs
            'lessons': [1, 2],  # IDs
        }
        rv = self.client.post(reverse('profileupdate_request'), data)
        assert rv.status_code == 200
        content = rv.content.decode('utf-8')
        assert 'Fix errors below' not in content
        assert \
            'Thank you for updating your instructor profile' in content
        assert ProfileUpdateRequest.objects.all().count() == 1
        assert ProfileUpdateRequest.objects.all()[0].active is True

        # Not testing if emails are sent because we don't send them out for
        # profile updates for now.
Test if ProfileUpdateRequest is successfully added.
dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_profile_update_request.py/TestProfileUpdateRequest.test_request_added