Skip to content

Commit

Permalink
Test added
Browse files Browse the repository at this point in the history
  • Loading branch information
ellmetha committed Mar 15, 2015
1 parent 92ae37e commit df4b284
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/functional/conversation/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,27 @@ def test_adds_the_username_field_if_the_user_is_anonymous(self):
post = form.save()
self.assertEqual(post.username, 'testname')

def test_adds_the_update_reason_field_if_the_post_is_updated(self):
# Setup
form_data = {
'subject': faker.text(max_nb_chars=200),
'content': '[b]{}[/b]'.format(faker.text()),
'update_reason': 'X',
}
# Run
form = PostForm(
data=form_data,
user=self.user,
user_ip=faker.ipv4(),
forum=self.top_level_forum,
topic=self.topic,
instance=self.post)
# Check
self.assertIn('update_reason', form.fields)
self.assertTrue(form.is_valid())
post = form.save()
self.assertEqual(post.update_reason, 'X')


class TestTopicForm(TestCase):
def setUp(self):
Expand Down

0 comments on commit df4b284

Please sign in to comment.