Skip to content

Commit

Permalink
Fixed a flaky test.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Dec 22, 2013
1 parent 046a8eb commit 3a30b9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/settings_tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import unittest
import warnings

Expand Down Expand Up @@ -231,7 +232,9 @@ def test_complex_override_warning(self):
self.assertEqual(settings.TEST_WARN, 'override')

self.assertEqual(len(w), 1)
self.assertEqual(w[0].filename, __file__)
# File extension may by .py, .pyc, etc. Compare only basename.
self.assertEqual(os.path.splitext(w[0].filename)[0],
os.path.splitext(__file__)[0])
self.assertEqual(str(w[0].message),
'Overriding setting TEST_WARN can lead to unexpected behaviour.')

Expand Down

0 comments on commit 3a30b9c

Please sign in to comment.