From 8891731d7d45fa6f401ee60a74882bf0a5fd2fab Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Fri, 21 Oct 2016 16:37:42 +0500 Subject: [PATCH] is_template_database_current: Open file in write mode. --- zerver/lib/test_fixtures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zerver/lib/test_fixtures.py b/zerver/lib/test_fixtures.py index 0f3d3b88e3..dd84347330 100644 --- a/zerver/lib/test_fixtures.py +++ b/zerver/lib/test_fixtures.py @@ -85,10 +85,10 @@ def _check_hash(target_hash_file, **options): else: source_hash_content = None - with open(source_hash_file, 'a+') as f: - f.truncate(0) + with open(source_hash_file, 'w') as f: f.write(target_hash_content) - return source_hash_content == target_hash_content + + return source_hash_content == target_hash_content def is_template_database_current( database_name='zulip_test_template',