mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-16 02:11:39 +00:00
[Minor] Fix Crop Cycle test record (#14901)
* fix crop cycle test record * load crop cycle doc if not yet loaded * create test records for location * land unit -> location , update in patch for tree index
This commit is contained in:
@@ -8,6 +8,7 @@ import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
test_records = frappe.get_test_records('Location')
|
||||
|
||||
class TestLocation(unittest.TestCase):
|
||||
def runTest(self):
|
||||
@@ -25,7 +26,7 @@ class TestLocation(unittest.TestCase):
|
||||
formatted_locations.extend(temp['features'])
|
||||
|
||||
formatted_location_string = str(formatted_locations)
|
||||
test_location = frappe.get_doc('Location', 'Test Location')
|
||||
test_location = frappe.get_doc('Location', 'Test Location Area')
|
||||
|
||||
self.assertEqual(formatted_location_string, str(json.loads(test_location.get('location'))['features']))
|
||||
self.assertEqual(area, test_location.get('area'))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Location",
|
||||
"location_name": "Test Location",
|
||||
"location_name": "Test Location Area",
|
||||
"is_group": 1,
|
||||
"is_container": 1
|
||||
},
|
||||
@@ -9,8 +9,8 @@
|
||||
"doctype": "Location",
|
||||
"location_name": "Basil Farm",
|
||||
"location": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"point_type\":\"circle\",\"radius\":884.5625420736483},\"geometry\":{\"type\":\"Point\",\"coordinates\":[72.875834,19.100566]}}]}",
|
||||
"parent_location": "Test Location",
|
||||
"parent": "Test Location",
|
||||
"parent_location": "Test Location Area",
|
||||
"parent": "Test Location Area",
|
||||
"is_group": 1,
|
||||
"is_container": 1
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user