Browse files

Fixed test that reads a migration file from disk.

We need to make sure content read from the file is decoded from UTF-8
right from the start so Python doesn't try to use another encoding
(read: ASCII/CP1252 under Windows.)
  • Loading branch information...
1 parent 78bc96c commit 88f03db05fb3c42648289fa6ed27d6c13e2719cb Ramiro Morales committed Oct 27, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 tests/migrations/
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+import codecs
import copy
import os
import shutil
@@ -143,8 +144,8 @@ def test_files_content(self):
# Check for existing file in migration folder
- with open(initial_file, 'r') as fp:
- content = force_text(
+ with, 'r', encoding='utf-8') as fp:
+ content =
self.assertTrue('# encoding: utf8' in content)
self.assertTrue('migrations.CreateModel' in content)

0 comments on commit 88f03db

Please sign in to comment.