Commits

Lukasz Balcerzak  committed 84007aa

Fixed MilestoneTest

  • Participants
  • Parent commits b83cba3

Comments (0)

Files changed (2)

File example_project/settings.py

 abspath = lambda *p: os.path.abspath(os.path.join(*p))
 
 DEBUG = True
+TEMPLATE_DEBUG = DEBUG
 PROJECTOR_HG_PUSH_SSL = False
 
 PROJECT_ROOT = abspath(os.path.dirname(__file__))

File projector/tests/test_milestone.py

 from projector.tests.base import ProjectorTestCase
 from projector.models import Project, Milestone
 
+
 class MilestoneTest(ProjectorTestCase):
 
     def setUp(self):
         new_milestone_name = u'milestone-1'
         response = self._get_response(
             url = self.project.get_milestone_add_url())
+        instance = response.context['form'].instance
+
+        created_at = instance.created_at.strftime('%Y-%m-%d')
+
         self._get_response(
             url = self.project.get_milestone_add_url(),
             data = {
                 'name': new_milestone_name,
                 'description': u'anything',
                 'deadline': deadline,
+                'created_at': created_at,
             },
             method = 'POST', follow = True)
 
                 'name': new_milestone_name,
                 'description': u'anything',
                 'deadline': deadline,
+                'created_at': created_at,
             },
             method = 'POST', follow = True)
 
                 'name': another_name,
                 'description': u'anything',
                 'deadline': deadline,
+                'created_at': created_at,
             },
             method = 'POST', follow = True)
         # Should not allow to update name of the milestone to one already
                 'name': new_milestone_name,
                 'description': u'anything',
                 'deadline': deadline,
+                'created_at': created_at,
             },
             method = 'POST', follow = True)
         name_field_errors = response.context['form']._errors['name']
             "so we shouldn't be able to change old name '%s' to this one"
             % (new_milestone_name, milestone.name))
 
-
-
-