Chris Moffitt committed 40d5ee0

Changing test case so it doesn't depend on a regex. Makes it a little more robust.

Comments (0)

Files changed (1)


     def setUp(self):
         from django.contrib.auth.models import Permission, User
         from django.contrib.contenttypes.models import ContentType
         # Users with different permissions
         # staff member
         user1 = User.objects.create_user('warehouseman', '', 'secret')
     def test_export(self):
         "Details of exported settings"
-        import re
         self.client.login(username='superuser', password='secret')
         val2 = IntegerValue(BASE_GROUP, 'ModifiedItem', default=0)
         response = self.client.get('/settings/export/')
-        export_pattern = re.compile(r'^LIVESETTINGS_OPTIONS = \\\n'
-                "{1: {'DB': False, 'SETTINGS': {u?'BASE': {u?'ModifiedItem': u?'6789'}}}}", flags=re.MULTILINE)
-        self.assertTrue(, response.content))  # pattern of exported settings
+        self.assertContains(response, "LIVESETTINGS_OPTIONS =", 1)
+        self.assertContains(response, "'DB': False", 1)
+        self.assertContains(response, "u'BASE':",1)
+        self.assertContains(response, " u'ModifiedItem': u'6789'",1)
     def test_secret_password(self):
         "Verify that password is saved but not re-echoed if render_value=False"