

def test_create(self):
    with self.app.app_context():
        user = User.create(email='r@rdegges.com', password='woot1LoveCookies!', given_name='Randall', surname='Degges')
        self.assertEqual(user.email, 'r@rdegges.com')
        self.assertEqual(user.given_name, 'Randall')
        self.assertEqual(user.surname, 'Degges')
        self.assertEqual(user.username, 'r@rdegges.com')
        self.assertEqual(user.middle_name, None)
        self.assertEqual(dict(user.custom_data), {
            'created_at': user.custom_data.created_at,
            'modified_at': user.custom_data.modified_at,
        })
        user.delete()
        user = User.create(email='r@rdegges.com', password='woot1LoveCookies!', given_name='Randall', surname='Degges', username='rdegges', middle_name='Clark', custom_data={
            'favorite_shows': ['Code Monkeys', 'The IT Crowd'],
            'friends': ['Sami', 'Alven'],
            'favorite_place': {
                'city': 'Santa Cruz',
                'state': 'California',
                'reason': 'Beautiful landscape.',
                'amount_of_likage': 99.9999,
            },
        })
        self.assertEqual(user.username, 'rdegges')
        self.assertEqual(user.middle_name, 'Clark')
        self.assertEqual(dict(user.custom_data), {
            'favorite_shows': ['Code Monkeys', 'The IT Crowd'],
            'friends': ['Sami', 'Alven'],
            'favorite_place': {
                'city': 'Santa Cruz',
                'state': 'California',
                'reason': 'Beautiful landscape.',
                'amount_of_likage': 99.9999,
            },
            'created_at': user.custom_data.created_at,
            'modified_at': user.custom_data.modified_at,
        })

dataset/ETHPy150Open stormpath/stormpath-flask/tests/test_models.py TestUser.test_create/original