mock.sentinel.VALUE1

Here are the examples of the python api mock.sentinel.VALUE1 taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

Example 1

Project: django-natural-query Source File: test_natural_query_descriptor.py
    def test_can_and_expressions_when_braces_are_present(self):
        field1 = NaturalQueryDescriptor('field1')
        field2 = NaturalQueryDescriptor('field2')

        expected = Q(field1__exact=sentinel.VALUE1, field2__exact=sentinel.VALUE2)

        actual = (field1 == sentinel.VALUE1) & (field2 == sentinel.VALUE2)

        self.assertEqual(actual, expected)

Example 2

Project: django-natural-query Source File: test_natural_query_descriptor.py
    def test_can_or_expressions_when_braces_are_present(self):
        field1 = NaturalQueryDescriptor('field1')
        field2 = NaturalQueryDescriptor('field2')

        expected = Q(field1__exact=sentinel.VALUE1) | Q(field2__exact=sentinel.VALUE2)

        actual = (field1 == sentinel.VALUE1) | (field2 == sentinel.VALUE2)

        self.assertEqual(actual, expected)

Example 3

Project: django-natural-query Source File: test_natural_query_descriptor.py
    def test_in_generates_the_right_expression_for_the_in_lookup(self):
        sut = self.system_under_test

        expected = Q(field__in=(sentinel.VALUE1, sentinel.VALUE2))

        actual = sut.in_values(sentinel.VALUE1, sentinel.VALUE2)

        self.assertEqual(actual, expected)

Example 4

Project: django-natural-query Source File: test_natural_query_descriptor.py
    def test_between_generates_the_right_expression_for_the_range_lookup(self):
        sut = self.system_under_test

        expected = Q(field__range=(sentinel.VALUE1, sentinel.VALUE2))

        actual = sut.between(sentinel.VALUE1, sentinel.VALUE2)

        self.assertEqual(actual, expected)

Example 5

Project: django-natural-query Source File: test_natural_query_descriptor.py
    @expectedFailure
    def test_cant_and_expressions_when_braces_are_not_present(self):
        field1 = NaturalQueryDescriptor('field1')
        field2 = NaturalQueryDescriptor('field2')

        expected = Q(field1__exact=sentinel.VALUE1, field2__exact=sentinel.VALUE2)

        actual = field1 == sentinel.VALUE1 & field2 == sentinel.VALUE2

        self.assertEqual(actual, expected)

Example 6

Project: django-natural-query Source File: test_natural_query_descriptor.py
    @expectedFailure
    def test_cant_or_expressions_when_braces_are_not_present(self):
        field1 = NaturalQueryDescriptor('field1')
        field2 = NaturalQueryDescriptor('field2')

        expected = Q(field1__exact=sentinel.VALUE1) | Q(field2__exact=sentinel.VALUE2)

        actual = field1 == sentinel.VALUE1 | field2 == sentinel.VALUE2

        self.assertEqual(actual, expected)