Exemplo n.º 1
0
    def test_abstract_when_contact_email_not_same_as_confirmation_email(self):
        form_data = {
            'meeting': 24,
            'year': 2015,
            'presentation_type': 'Paper',
            'title': """<p>A test title with strange characters &part;13C and species names
             like <em>Australopithecus afarensis</em></p>""",

            'abstract_text': """<p>You think water moves fast? You should see ice. It moves like it has a mind. Like it
             knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb
             out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the
             slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was
             the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.
             </p>""",

            'acknowledgements': 'I gratefully acknowledge the academy.',
            'contact_email': '*****@*****.**',   # valid email address
            'confirm_email':  '*****@*****.**',  # valid email address, but not same as above
            'author_set-0-name': 'Denne Reed',
            'author_set-0-department': 'Anthropology',
            'author_set-0-institution': 'University of Texas at Austin',
            'author_set-0-country': 'United States of America',
            'author_set-0-email_address': '*****@*****.**',
        }
        request = self.factory.post(reverse('meetings:create_abstract'), form_data)
        request.user = AnonymousUser()
        response = AbstractCreateView.as_view()(request)
        self.assertEqual(response.status_code, 200)  # test that on submit we return the form again
Exemplo n.º 2
0
 def test_abstract_create_view_with_empty_post_data(self):
     request = self.factory.post(reverse('meetings:create_abstract'), {})
     request.user = AnonymousUser()
     response = AbstractCreateView.as_view()(request)
     self.assertEqual(response.status_code, 200)
Exemplo n.º 3
0
 def test_get(self):
     request = self.factory.get(reverse('meetings:create_abstract'))
     request.user = AnonymousUser()
     response = AbstractCreateView.as_view()(request)
     self.assertEqual(response.status_code, 200)