Esempio n. 1
0
 def setUp(self):
     user = User.objects.create_user(email='*****@*****.**')
     event = create_test_event()
     attendee = Attendee.objects.create(user=user, event=event)
     self.speaker = Speaker.objects.create(user=attendee,
                                           videopermission=True,
                                           shirt_size=1)
Esempio n. 2
0
    def test_can_delete_speaker_without_talk(self):
        attendee = Attendee.objects.create(user=self.user,
                                           event=create_test_event())
        create_test_speaker(attendee)

        self.client.login(username='******', password='******')
        r = self.client.post('/accounts/delete/')
        self.assertEquals(r.status_code, 302)
        self.assertEquals(r.url, '/')

        with self.assertRaises(DevDayUser.DoesNotExist):
            self.user.refresh_from_db()
Esempio n. 3
0
    def test_cannot_delete_speaker_with_talk(self):
        attendee = Attendee.objects.create(user=self.user,
                                           event=create_test_event())
        speaker = create_test_speaker(attendee)
        create_test_talk(speaker)

        self.client.login(username='******', password='******')
        r = self.client.post('/accounts/delete/')
        self.assertEquals(r.status_code, 409)

        self.user.refresh_from_db()
        self.assertIsNotNone(self.user.id)
Esempio n. 4
0
 def setUp(self):
     user = User.objects.create_user(email='*****@*****.**')
     event = create_test_event()
     attendee = Attendee.objects.create(user=user, event=event)
     self.speaker = Speaker.objects.create(user=attendee,
                                           videopermission=True,
                                           shirt_size=1)
     self.talk = Talk.objects.create(speaker=self.speaker,
                                     title='Test',
                                     abstract='Test abstract',
                                     remarks='Test remarks')
     self.voter = User.objects.create_user(email='*****@*****.**')
Esempio n. 5
0
 def setUp(self):
     user = User.objects.create_user(email='*****@*****.**')
     event = create_test_event()
     self.attendee = Attendee.objects.create(user=user, event=event)