Explorar el Código

fixed test cases

version-14
Anand Doshi hace 10 años
padre
commit
eb2c11a184
Se han modificado 3 ficheros con 10 adiciones y 5 borrados
  1. +2
    -1
      frappe/__init__.py
  2. +6
    -2
      frappe/desk/doctype/event/event.py
  3. +2
    -2
      frappe/model/document.py

+ 2
- 1
frappe/__init__.py Ver fichero

@@ -859,11 +859,12 @@ def get_all(doctype, *args, **kwargs):
def add_version(doc):
"""Insert a new **Version** of the given document.
A **Version** is a JSON dump of the current document state."""
from frappe.utils.response import json_handler
get_doc({
"doctype": "Version",
"ref_doctype": doc.doctype,
"docname": doc.name,
"doclist_json": json.dumps(doc.as_dict(), indent=1, sort_keys=True)
"doclist_json": json.dumps(doc.as_dict(), indent=1, sort_keys=True, default=json_handler)
}).insert(ignore_permissions=True)

def get_test_records(doctype):


+ 6
- 2
frappe/desk/doctype/event/event.py Ver fichero

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe

from frappe.utils import getdate, cint, add_months, date_diff, add_days, nowdate
from frappe.utils import getdate, cint, add_months, date_diff, add_days, nowdate, get_datetime_str
from frappe.model.document import Document
from frappe.utils.user import get_enabled_system_users

@@ -114,7 +114,11 @@ def get_events(start, end, user=None, for_reminder=False):

for e in events:
if e.repeat_this_event:
event_start, time_str = e.starts_on.split(" ")
e.starts_on = get_datetime_str(e.starts_on)
if e.ends_on:
e.ends_on = get_datetime_str(e.ends_on)

event_start, time_str = get_datetime_str(e.starts_on).split(" ")
if e.repeat_till == None or "":
repeat = "3000-01-01"
else:


+ 2
- 2
frappe/model/document.py Ver fichero

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt, cint, cstr, now
from frappe.utils import flt, cint, cstr, now, get_datetime_str
from frappe.model.base_document import BaseDocument, get_controller
from frappe.model.naming import set_new_name
from werkzeug.exceptions import NotFound, Forbidden
@@ -661,4 +661,4 @@ class Document(BaseDocument):

def get_signature(self):
"""Returns signature (hash) for private URL."""
return hashlib.sha224(self.creation).hexdigest()
return hashlib.sha224(get_datetime_str(self.creation)).hexdigest()

Cargando…
Cancelar
Guardar