def test_properties(self): user = User() user.email = '*****@*****.**' user.user_id = 1234 user.name = 'Joe' user.last_seen_ip = '192.168.1.100' user.last_seen_user_agent = 'Mozilla/5.0' user.created_at = datetime.fromtimestamp(1331764344) user.custom_data = { 'name': 'Ace' } try: # cannot set the relationship score user.relationship_score = 50 except AttributeError: pass self.assertEqual('*****@*****.**', user.email) self.assertEqual(1234, user.user_id) self.assertEqual('Joe', user.name) self.assertEqual('192.168.1.100', user.last_seen_ip) self.assertEqual('Mozilla/5.0', user.last_seen_user_agent) self.assertEqual(None, user.relationship_score) self.assertEqual(1331764344, time.mktime(user.created_at.timetuple())) self.assertEqual('Ace', user.custom_data['name'])
def test_user_properties(): created_at = datetime.fromtimestamp(1331764344) last_request_at = datetime.fromtimestamp(1331764345) last_impression_at = datetime.fromtimestamp(1331764346) user = User() user.email = '*****@*****.**' user.user_id = 1234 user.name = 'Somebody' user.last_seen_ip = '192.168.1.100' user.last_seen_user_agent = 'Mozilla/5.0' user.last_request_at = last_request_at user.last_impression_at = last_impression_at user.created_at = created_at user.unsubscribed_from_emails = True user.custom_data = {'name': 'Ace'} user.companies = [{ 'id': 1, 'name': 'Intercom', 'created_at': created_at}] try: # cannot set the relationship score user.relationship_score = 50 raise AttributeError except AttributeError: pass eq_(user.email, '*****@*****.**') eq_(user.user_id, 1234) eq_(user.name, 'Somebody') eq_(user.last_seen_ip, '192.168.1.100') eq_(user.last_seen_user_agent, 'Mozilla/5.0') eq_(user.last_request_at, last_request_at) eq_(user.last_impression_at, last_impression_at) eq_(user.relationship_score, None) eq_(user.created_at, created_at) eq_(user.unsubscribed_from_emails, True) eq_(user.custom_data['name'], 'Ace') eq_(user.session_count, 0) raises(AttributeError, lambda: user.companies)
def test_user_properties(): created_at = datetime.fromtimestamp(1331764344) last_request_at = datetime.fromtimestamp(1331764345) last_impression_at = datetime.fromtimestamp(1331764346) user = User() user.email = '*****@*****.**' user.user_id = 1234 user.name = 'Somebody' user.last_seen_ip = '192.168.1.100' user.last_seen_user_agent = 'Mozilla/5.0' user.last_request_at = last_request_at user.last_impression_at = last_impression_at user.created_at = created_at user.unsubscribed_from_emails = True user.custom_data = {'name': 'Ace'} user.companies = [{'id': 1, 'name': 'Intercom', 'created_at': created_at}] try: # cannot set the relationship score user.relationship_score = 50 raise AttributeError except AttributeError: pass eq_(user.email, '*****@*****.**') eq_(user.user_id, 1234) eq_(user.name, 'Somebody') eq_(user.last_seen_ip, '192.168.1.100') eq_(user.last_seen_user_agent, 'Mozilla/5.0') eq_(user.last_request_at, last_request_at) eq_(user.last_impression_at, last_impression_at) eq_(user.relationship_score, None) eq_(user.created_at, created_at) eq_(user.unsubscribed_from_emails, True) eq_(user.custom_data['name'], 'Ace') eq_(user.session_count, 0) raises(AttributeError, lambda: user.companies)
def test_properties(self): user = User() user.email = '*****@*****.**' user.user_id = 1234 user.name = 'Joe' user.last_seen_ip = '192.168.1.100' user.last_seen_user_agent = 'Mozilla/5.0' user.created_at = datetime.fromtimestamp(1331764344) user.custom_data = {'name': 'Ace'} try: # cannot set the relationship score user.relationship_score = 50 except AttributeError: pass self.assertEqual('*****@*****.**', user.email) self.assertEqual(1234, user.user_id) self.assertEqual('Joe', user.name) self.assertEqual('192.168.1.100', user.last_seen_ip) self.assertEqual('Mozilla/5.0', user.last_seen_user_agent) self.assertEqual(None, user.relationship_score) self.assertEqual(1331764344, time.mktime(user.created_at.timetuple())) self.assertEqual('Ace', user.custom_data['name'])