mock.sentinel.FIELD_NAME

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

8 Examples 7

Example 1

View license
    def test_equals_operator_generates_the_right_expression_for_the_exact_lookup_when_comparing_to_another_field(self):
        sut = self.system_under_test
        expected = Q(field__exact=F(sentinel.FIELD_NAME))

        actual = sut == self.field

        self.assertEqual(actual, expected)

Example 2

View license
    def test_greater_than_operator_generates_the_right_expression_for_the_gt_lookup_when_comparing_to_another_field(
            self):
        sut = self.system_under_test
        expected = Q(field__gt=F(sentinel.FIELD_NAME))

        actual = sut > self.field

        self.assertEqual(actual, expected)

Example 3

View license
    def test_greater_than_or_equal_operator_generates_the_right_expression_for_the_gte_lookup_when_comparing_to_another_field(

            self):
        sut = self.system_under_test
        expected = Q(field__gte=F(sentinel.FIELD_NAME))

        actual = sut >= self.field

        self.assertEqual(actual, expected)

Example 4

View license
    def test_less_than_operator_generates_the_right_expression_for_the_lt_lookup_when_comparing_to_another_field(self):
        sut = self.system_under_test
        expected = Q(field__lt=F(sentinel.FIELD_NAME))

        actual = sut < self.field

        self.assertEqual(actual, expected)

Example 5

View license
    def test_less_than_or_equal_operator_generates_the_right_expression_for_the_lte_lookup_when_comparing_to_another_field(
            self):
        sut = self.system_under_test
        expected = Q(field__lte=F(sentinel.FIELD_NAME))

        actual = sut <= self.field

        self.assertEqual(actual, expected)

Example 6

View license
    def test_not_equal_operator_generates_the_right_negated_expression_for_the_exact_lookup_when_comparing_to_another_field(
            self):
        sut = self.system_under_test
        expected = ~Q(field__exact=F(sentinel.FIELD_NAME))

        actual = sut != self.field

        self.assertEqual(actual, expected)

Example 7

View license
    @property
    def field(self):
        return NaturalQueryDescriptor(name=sentinel.FIELD_NAME)

Example 8

View license
    @property
    def field(self):
        return Field(name=sentinel.FIELD_NAME)