Did I find the right examples for you? yes no

All Samples(186)  |  Call(186)  |  Derive(0)  |  Import(0)

src/d/e/dead-parrot-HEAD/tests/unit/test_models.py   dead-parrot(Download)
            }
        })
        john = self.Person(id=1,
                           name=u'John Doe',
                           creation_date=dtime,
            }
        })
        john1 = self.Person(id=1,
                            name=u'John Doe',
                            creation_date=dtime,
            </Person>
        ''' % dtime.strftime("%Y-%m-%d %H:%M:%S")
        john = self.Person(id=1,
                           name=u'John Doe',
                           creation_date=dtime,
            </Person>
        ''' % dtime.strftime("%Y-%m-%d %H:%M:%S")
        john1 = self.Person(id=1,
                           name=u'John Doe',
                           creation_date=dtime,
            }
        })
        john = self.Person(id=1,
                           name=u'John Doe',
                           creation_date=dtime,

src/n/o/noc-0.7(3)/contrib/src/mongoengine/tests/document.py   noc(Download)
    def test_creation(self):
        """Ensure that document may be created using keyword arguments.
        """
        person = self.Person(name="Test User", age=30)
        self.assertEqual(person.name, "Test User")
        self.assertEqual(person.age, 30)
 
    def test_to_dbref(self):
        """Ensure that you can get a dbref of a document"""
        person = self.Person(name="Test User", age=30)
    def test_reload(self):
        """Ensure that attributes may be reloaded.
        """
        person = self.Person(name="Test User", age=20)
        person.save()
    def test_dictionary_access(self):
        """Ensure that dictionary-style field access works properly.
        """
        person = self.Person(name='Test User', age=30)
        self.assertEquals(person['name'], 'Test User')
    def test_save(self):
        """Ensure that a document may be saved in the database.
        """
        # Create person object and save it to the database
        person = self.Person(name='Test User', age=30)

src/m/o/mongoengine-0.8.7/tests/document/instance.py   mongoengine(Download)
    def test_creation(self):
        """Ensure that document may be created using keyword arguments.
        """
        person = self.Person(name="Test User", age=30)
        self.assertEqual(person.name, "Test User")
        self.assertEqual(person.age, 30)
 
    def test_to_dbref(self):
        """Ensure that you can get a dbref of a document"""
        person = self.Person(name="Test User", age=30)
    def test_reload(self):
        """Ensure that attributes may be reloaded.
        """
        person = self.Person(name="Test User", age=20)
        person.save()
    def test_dictionary_access(self):
        """Ensure that dictionary-style field access works properly.
        """
        person = self.Person(name='Test User', age=30)
        self.assertEqual(person['name'], 'Test User')
    def test_save(self):
        """Ensure that a document may be saved in the database.
        """
        # Create person object and save it to the database
        person = self.Person(name='Test User', age=30)

src/m/o/mongoengine-HEAD/tests/test_document.py   mongoengine(Download)
    def test_creation(self):
        """Ensure that document may be created using keyword arguments.
        """
        person = self.Person(name="Test User", age=30)
        self.assertEqual(person.name, "Test User")
        self.assertEqual(person.age, 30)
 
    def test_to_dbref(self):
        """Ensure that you can get a dbref of a document"""
        person = self.Person(name="Test User", age=30)
    def test_reload(self):
        """Ensure that attributes may be reloaded.
        """
        person = self.Person(name="Test User", age=20)
        person.save()
    def test_dictionary_access(self):
        """Ensure that dictionary-style field access works properly.
        """
        person = self.Person(name='Test User', age=30)
        self.assertEqual(person['name'], 'Test User')
    def test_save(self):
        """Ensure that a document may be saved in the database.
        """
        # Create person object and save it to the database
        person = self.Person(name='Test User', age=30)

src/n/o/noc-0.7(3)/contrib/src/mongoengine/tests/queryset.py   noc(Download)
    def test_find(self):
        """Ensure that a query returns a valid set of results.
        """
        person1 = self.Person(name="User A", age=20)
        person1.save()
        person2 = self.Person(name="User B", age=30)
        self.assertEqual(people[0].name, 'User B')
 
        person3 = self.Person(name="User C", age=40)
        person3.save()
 
    def test_find_one(self):
        """Ensure that a query using find_one returns a valid result.
        """
        person1 = self.Person(name="User A", age=20)
        person1.save()
        person2 = self.Person(name="User B", age=30)

src/m/o/mongoengine-HEAD/tests/test_queryset.py   mongoengine(Download)
    def test_find(self):
        """Ensure that a query returns a valid set of results.
        """
        person1 = self.Person(name="User A", age=20)
        person1.save()
        person2 = self.Person(name="User B", age=30)
        self.assertEqual(people[0].name, 'User B')
 
        person3 = self.Person(name="User C", age=40)
        person3.save()
 
    def test_find_one(self):
        """Ensure that a query using find_one returns a valid result.
        """
        person1 = self.Person(name="User A", age=20)
        person1.save()
        person2 = self.Person(name="User B", age=30)

src/m/o/mongoengine-0.8.7/tests/queryset/queryset.py   mongoengine(Download)
        self.assertEqual(people[0].name, 'User B')
 
        person3 = self.Person(name="User C", age=40)
        person3.save()
 
    def test_find_one(self):
        """Ensure that a query using find_one returns a valid result.
        """
        person1 = self.Person(name="User A", age=20)
        person1.save()
        person2 = self.Person(name="User B", age=30)
        self.assertRaises(self.Person.DoesNotExist, self.Person.objects.get)
 
        person1 = self.Person(name="User A", age=20)
        person1.save()
        person2 = self.Person(name="User B", age=30)

src/m/o/mongoengine-HEAD/tests/test_dynamic_document.py   mongoengine(Download)
    def test_simple_dynamic_document(self):
        """Ensures simple dynamic documents are saved correctly"""
 
        p = self.Person()
        p.name = "James"
    def test_dynamic_document_delta(self):
        """Ensures simple dynamic documents can delta correctly"""
        p = self.Person(name="James", age=34)
        self.assertEqual(p._delta(), ({'_types': ['Person'], 'age': 34, 'name': 'James', '_cls': 'Person'}, {}))
 
    def test_change_scope_of_variable(self):
        """Test changing the scope of a dynamic field has no adverse effects"""
        p = self.Person()
        p.name = "Dean"
        p.misc = 22
    def test_delete_dynamic_field(self):
        """Test deleting a dynamic field works"""
        self.Person.drop_collection()
        p = self.Person()
        p.name = "Dean"
    def test_dynamic_document_queries(self):
        """Ensure we can query dynamic fields"""
        p = self.Person()
        p.name = "Dean"
        p.age = 22

src/m/o/mongoengine-0.8.7/tests/queryset/field_list.py   mongoengine(Download)
    def test_only(self):
        """Ensure that QuerySet.only only returns the requested fields.
        """
        person = self.Person(name='test', age=25)
        person.save()

src/m/o/mongoengine-0.8.7/tests/queryset/visitor.py   mongoengine(Download)
    def test_q_regex(self):
        """Ensure that Q objects can be queried using regexes.
        """
        person = self.Person(name='Guido van Rossum')
        person.save()

  1 | 2  Next