def test_field_returns_none_if_no_datetime_passed_in(self):
     field = JSTimestampField()
     self.assertEqual(field.to_representation(None), None)
 def test_field_serializes_to_js_time_format(self):
     field = JSTimestampField()
     example_datetime = datetime.datetime(2000, 1, 1, 1, 1, 1, 1)
     self.assertEqual(field.to_representation(example_datetime),
                      946688461000.0)