# Path: tests/helpers/movie_data.py
# class Actor(Document):
# 
#     name = CharField(indexed = True)
#     gross_income_m = FloatField(indexed = True)
#     salary_amount = FloatField(indexed = True,key = 'salary.amount')
#     salary_currency = CharField(indexed = True,key = 'salary.currency')
#     appearances = IntegerField(indexed = True)
#     birth_year = IntegerField(indexed = True)
#     favorite_food = ManyToManyField('Food')
#     is_funny = BooleanField(indexed = True)
#     movies = ManyToManyField('Movie',backref = 'actors')
# 
# class Movie(Document):
# 
#     title = CharField(nullable = True,indexed = True)
#     director = ForeignKeyField(related = 'Director',nullable = True,backref = 'movies')
#     cast = ManyToManyField(related = 'Actor')
#     year = IntegerField(indexed = True)
#     best_actor = ForeignKeyField('Actor',backref = 'best_movies')
# 
#     class Meta(Document.Meta):
# 
#         dbref_includes = ['title','year']


from .helpers.movie_data import Actor, Movie
from __future__ import absolute_import



def test_nested_value(backend):

    actor = Actor({'name' : 'Robert de Niro'})

# Path: tests/helpers/movie_data.py
# class Actor(Document):
# 
#     name = CharField(indexed = True)
#     gross_income_m = FloatField(indexed = True)
#     salary_amount = FloatField(indexed = True,key = 'salary.amount')
#     salary_currency = CharField(indexed = True,key = 'salary.currency')
#     appearances = IntegerField(indexed = True)
#     birth_year = IntegerField(indexed = True)
#     favorite_food = ManyToManyField('Food')
#     is_funny = BooleanField(indexed = True)
#     movies = ManyToManyField('Movie',backref = 'actors')
# 
# class Movie(Document):
# 
#     title = CharField(nullable = True,indexed = True)
#     director = ForeignKeyField(related = 'Director',nullable = True,backref = 'movies')
#     cast = ManyToManyField(related = 'Actor')
#     year = IntegerField(indexed = True)
#     best_actor = ForeignKeyField('Actor',backref = 'best_movies')
# 
#     class Meta(Document.Meta):
# 
#         dbref_includes = ['title','year']


# Path: tests/test_dbref_includes.py
from .helpers.movie_data import Actor, Movie

from __future__ import absolute_import



def test_nested_value(backend):

    actor = Actor({'name' : 'Robert de Niro'})

    movie = Movie({'best_actor' : actor,'title' : 'The Godfather'})