Commit Graph

21 Commits

Author SHA1 Message Date
Steve Howell 9fb071947d Remove expected_run_time from @slow test decorator. 2016-07-29 16:41:21 -07:00
Steve Howell 38f2a2f475 Add client_post() test helper.
This makes us more consistent, since we have other wrappers
like client_patch, client_put, and client_delete.

Wrapping also will facilitate instrumentation of our posting code.
2016-07-27 20:49:32 -07:00
Steve Howell eb11e02309 Add MirroredMessageUsersTest. 2016-07-26 20:01:36 -07:00
Steve Howell e341fe0102 Use topic_name() in do_edit_message_assert_error(). 2016-07-18 14:10:11 -07:00
Steve Howell 6afa22f473 Add LogDictTest.test_to_log_dict(). 2016-07-17 11:25:02 -07:00
Rishi Gupta d529a94e4d Add realm setting to time-limit editing of message content.
This is controlled through the admin tab and a new field in the Realms table.
Notes:
* The admin tab setting takes a value in minutes, whereas the backend stores it
  in seconds.
* This setting is unused when allow_message_editing is false.
* There is some generosity in how the limit is enforced. For instance, if the
  user sees the hovering edit button, we ensure they have at least 5 seconds to
  click it, and if the user gets to the message edit form, we ensure they have
  at least 10 seconds to make the edit, by relaxing the limit.
* This commit also includes a countdown timer in the message edit form.

Resolves #903.
2016-07-15 13:55:49 -07:00
Steve Howell 9d7716f368 Add message.topic_name() helper function.
This little helper will facilitate adding a new Topic
table in the future.
2016-07-14 09:54:56 -07:00
Tim Abbott 05632b68e1 edit: Add validation for setting empty content. 2016-07-10 18:01:59 -07:00
Tim Abbott 0d418d5695 Add some message editing tests for invalid input. 2016-07-10 18:01:59 -07:00
Tim Abbott 1e2d38e790 Move stringify_message_dict into to_dict_uncached. 2016-07-08 17:58:56 -07:00
Tim Abbott a05c03d3b5 test_messages: Fix trying to login as a bot user.
Due to a recent refactoring, the first user in the subscribers list is
now a bot.
2016-06-27 11:48:39 -07:00
Tim Abbott 370b38696a test_messages: Fix broken huddle messages test.
The second login call was failing because the user didn't exist.
2016-06-27 11:48:36 -07:00
Tomasz Kolek 7aa45ffa45 Increase send_message_backend coverage. 2016-06-21 14:33:21 -07:00
Tim Abbott 50f723f50b Split test_narrow.py out of test_messages.py. 2016-06-21 12:25:08 -07:00
Tomasz Kolek e3e03e2946 Add NarrowBuilder test cases.
Refactor existing add_term test cases.
2016-06-21 11:53:31 -07:00
Tim Abbott 3a0eb01dda test_messages: Fix huddle test failing when not on Internet. 2016-06-03 23:18:39 -07:00
Tomasz Kolek 8c18b8947f Add bot_type field to UserProfile.
This is intended to support creating different types of bots with
potentially limited permissions.
2016-05-19 22:37:37 -07:00
rahuldeve dde832b158 Add Attachment model to keep track of uploads.
This commit adds the capability to keep track and remove uploaded
files.  Unclaimed attachments are files that have been uploaded to the
server but are not referred in any messages.  A management command to
remove old unclaimed files after a week is also included.

Tests for getting the file referred in messages are also included.
2016-05-02 22:14:47 -07:00
Tomasz Kolek 12fc4f047c test_helpers: Create get_last_message helper. 2016-04-26 09:54:02 -07:00
Tim Abbott f6edc21981 Change stream used in test_get_old_messages_with_only_searching_anchor.
This prevents this test from breaking when in a few commits we fix a
nondeterminism issue in the populate_db test fixtures.
2016-04-13 13:19:02 -07:00
Tim Abbott be96cf809d Move Zulip backend tests to zerver.tests. 2016-04-11 22:16:09 -07:00