listdir doesn't give sorted files of course.
authorMarcin Koziej <marcin@lolownia.org>
Mon, 21 May 2012 09:54:18 +0000 (11:54 +0200)
committerMarcin Koziej <marcin@lolownia.org>
Mon, 21 May 2012 09:54:18 +0000 (11:54 +0200)
apps/catalogue/tests/__init__.py

index ac9298c..3421d33 100755 (executable)
@@ -136,6 +136,7 @@ class GalleryAppendTests(TestCase):
         self.book1.append(self.book2)
 
         files = listdir(join(self.scandir, self.book1.gallery))
+        files.sort()
         self.assertEqual(files, [
             '1-0001_1l',
             '1-0001_2r',
@@ -169,6 +170,7 @@ class GalleryAppendTests(TestCase):
         self.book1.append(self.book2)
 
         files = listdir(join(self.scandir, self.book1.gallery))
+        files.sort()
         print files
         self.assertEqual(files, [
             '0-0001_1l',
@@ -202,6 +204,7 @@ class GalleryAppendTests(TestCase):
         self.book1.append(self.book2)
 
         files = listdir(join(self.scandir, self.book1.gallery))
+        files.sort()
         print files
         self.assertEqual(files, [
             '0-1-0001_1l',