Ejemplo n.º 1
0
    def test_valid_user_note_form_create(self):
        form = UserNoteForm(data={
            'note_to': self.user_agent.pk,
            'text': 'test note',
            'type': UserNote.TYPE_TEXT,
        },
                            initial={
                                'user': self.user_candidate,
                            })

        self.assertTrue(form.is_valid())

        user_note = form.save()

        self.assertTrue(user_note)
Ejemplo n.º 2
0
    def test_valid_user_note_form_update(self):
        user_note = G(UserNote,
                      note_by=self.user_candidate,
                      note_to=self.user_agent)

        form = UserNoteForm(instance=user_note,
                            data={
                                'note_to': self.user_agent.pk,
                                'text': 'test note',
                                'type': UserNote.TYPE_TEXT,
                            })

        self.assertTrue(form.is_valid())

        user_note = form.save()

        self.assertTrue(user_note)