Skip to content

Commit ea2144e

Browse files
committed
RDBC-889 7.0 fixes
1 parent 08c5ad2 commit ea2144e

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

ravendb/tests/jvm_migrated_tests/issues_tests/test_ravenDB_12030.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import unittest
2+
13
from ravendb import AbstractIndexCreationTask
24
from ravendb.documents.indexes.definitions import FieldIndexing
35
from ravendb.infrastructure.orders import Company
@@ -20,6 +22,7 @@ class TestRavenDB12030(TestBase):
2022
def setUp(self):
2123
super().setUp()
2224

25+
@unittest.skip("Corax doesn't support proximity")
2326
def test_simple_proximity(self):
2427
Fox_Search().execute(self.store)
2528
with self.store.open_session() as session:
@@ -49,6 +52,7 @@ def test_simple_proximity(self):
4952
self.assertEqual("a quick brown fox", foxes[0].name)
5053
self.assertEqual("the fox is quick", foxes[1].name)
5154

55+
@unittest.skip("Corax doesn't support fuzzy")
5256
def test_simple_fuzzy(self):
5357
with self.store.open_session() as session:
5458
hr = Company()

ravendb/tests/jvm_migrated_tests/issues_tests/test_ravenDB_903.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import unittest
12
from typing import Callable
23

34
from ravendb.documents.indexes.definitions import FieldIndexing
@@ -44,6 +45,7 @@ def do_test(self, query_function: Callable[[DocumentSession], DocumentQuery]):
4445
products = list(query)
4546
self.assertEqual(1, len(products))
4647

48+
@unittest.skip("Corax doesn't support intersect queries")
4749
def test_test_1(self):
4850
def function(session: DocumentSession):
4951
return (
@@ -55,6 +57,7 @@ def function(session: DocumentSession):
5557

5658
self.do_test(function)
5759

60+
@unittest.skip("Corax doesn't support intersect queries")
5861
def test_test_2(self):
5962
def function(session: DocumentSession):
6063
return (

ravendb/tests/jvm_migrated_tests/issues_tests/test_ravenDB_9745.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import unittest
12
from typing import Optional
23

34
from ravendb import AbstractIndexCreationTask, Explanations, ExplanationOptions
@@ -33,6 +34,7 @@ class TestRavenDB9745(TestBase):
3334
def setUp(self):
3435
super(TestRavenDB9745, self).setUp()
3536

37+
@unittest.skip("Corax doesn't support explanations yet")
3638
def test_explain(self):
3739
Companies_ByName().execute(self.store)
3840

ravendb/tests/jvm_migrated_tests/more_like_this_tests/test_more_like_this.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,24 @@ class ComplexProperty:
2828
def __init__(self, body: str = None):
2929
self.body = body
3030

31+
@classmethod
32+
def from_json(cls, json_dict: dict):
33+
return cls(json_dict["body"])
34+
35+
def to_json(self):
36+
return {"body": self.body}
37+
3138

3239
class ComplexData:
33-
def __init__(self, Id: str = None, property_: ComplexProperty = None):
34-
self.Id = Id
35-
self.property_ = property_
40+
def __init__(self, prop: ComplexProperty = None):
41+
self.prop = prop
42+
43+
@classmethod
44+
def from_json(cls, json_dict: dict):
45+
return cls(ComplexProperty.from_json(json_dict["prop"]))
46+
47+
def to_json(self):
48+
return {"prop": self.prop}
3649

3750

3851
class DataIndex(AbstractIndexCreationTask):
@@ -54,7 +67,7 @@ def __init__(self, term_vector: bool = True, store: bool = False):
5467
class ComplexDataIndex(AbstractIndexCreationTask):
5568
def __init__(self):
5669
super(ComplexDataIndex, self).__init__()
57-
self.map = "from doc in docs.ComplexDatas select new { doc.property_, doc.property_.body }"
70+
self.map = "from doc in docs.ComplexDatas select new { doc.prop, doc.prop.body }"
5871
self._index("body", FieldIndexing.SEARCH)
5972

6073

@@ -352,7 +365,7 @@ def test_can_make_dynamic_document_queries_with_complex_properties(self):
352365

353366
with self.store.open_session() as session:
354367
complex_property = ComplexProperty("test")
355-
complex_data = ComplexData(property_=complex_property)
368+
complex_data = ComplexData(prop=complex_property)
356369

357370
session.store(complex_data)
358371
session.save_changes()
@@ -364,7 +377,7 @@ def test_can_make_dynamic_document_queries_with_complex_properties(self):
364377

365378
results = list(
366379
session.query_index_type(ComplexDataIndex, ComplexData).more_like_this(
367-
lambda f: f.using_document('{ "Property": { "Body": "test" } }').with_options(options)
380+
lambda f: f.using_document('{ "property": { "body": "test" } }').with_options(options)
368381
)
369382
)
370383
self.assertEqual(1, len(results))

0 commit comments

Comments
 (0)