'Test that we can delete a due date extension after deleting the normal
due date, without causing an error.'

def test_reset_extension_to_deleted_date(self):

    url = reverse('change_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
    response = self.client.post(url, {'student': self.user1.username, 'url': self.week1.location.to_deprecated_string(), 'due_datetime': '12/30/2013    00:00'})
    self.assertEqual(response.status_code, 200, response.content)
    self.assertEqual(datetime.datetime(2013, 12, 30, 0, 0, tzinfo=utc), get_extended_due(self.course, self.week1, self.user1))
    self.week1.due = None
    self.week1 = self.store.update_item(self.week1, self.user1.id)
    url = reverse('reset_due_date', kwargs={'course_id': self.course.id.to_deprecated_string()})
    response = self.client.post(url, {'student': self.user1.username, 'url': self.week1.location.to_deprecated_string()})
    self.assertEqual(response.status_code, 200, response.content)
    self.assertEqual(None, get_extended_due(self.course, self.week1, self.user1))
