Beispiel #1
0
 def testGetAll(self):
   users._UserModel(id='one', ga_domain='xyz.com', email='*****@*****.**').put()
   users._UserModel(id='two', ga_domain='abc.com', email='*****@*****.**').put()
   [user1, user2] = sorted(users.GetAll(), key=lambda u: u.id)
   self.assertEquals(('one', 'xyz.com', '*****@*****.**'),
                     (user1.id, user1.ga_domain, user1.email))
   self.assertEquals(('two', 'abc.com', '*****@*****.**'),
                     (user2.id, user2.ga_domain, user2.email))
Beispiel #2
0
 def testGetAll(self):
   users._UserModel(id='one', ga_domain='xyz.com', email='*****@*****.**').put()
   users._UserModel(id='two', ga_domain='abc.com', email='*****@*****.**').put()
   [user1, user2] = sorted(users.GetAll(), key=lambda u: u.id)
   self.assertEquals(('one', 'xyz.com', '*****@*****.**'),
                     (user1.id, user1.ga_domain, user1.email))
   self.assertEquals(('two', 'abc.com', '*****@*****.**'),
                     (user2.id, user2.ga_domain, user2.email))
Beispiel #3
0
 def testSetMarketingConsent(self):
     users._UserModel(id='1', ga_domain='xyz.com', email='*****@*****.**').put()
     self.assertEquals(False, users.Get('1').marketing_consent_answered)
     self.assertEquals(False, users.Get('1').marketing_consent)
     users.SetMarketingConsent('1', False)
     self.assertEquals(True, users.Get('1').marketing_consent_answered)
     self.assertEquals(False, users.Get('1').marketing_consent)
     users.SetMarketingConsent('1', True)
     self.assertEquals(True, users.Get('1').marketing_consent_answered)
     self.assertEquals(True, users.Get('1').marketing_consent)
Beispiel #4
0
 def testSetMarketingConsent(self):
   users._UserModel(id='1', ga_domain='xyz.com', email='*****@*****.**').put()
   self.assertEquals(False, users.Get('1').marketing_consent_answered)
   self.assertEquals(False, users.Get('1').marketing_consent)
   users.SetMarketingConsent('1', False)
   self.assertEquals(True, users.Get('1').marketing_consent_answered)
   self.assertEquals(False, users.Get('1').marketing_consent)
   users.SetMarketingConsent('1', True)
   self.assertEquals(True, users.Get('1').marketing_consent_answered)
   self.assertEquals(True, users.Get('1').marketing_consent)
Beispiel #5
0
 def testSetWelcomeMessageDismissed(self):
     users._UserModel(id='1', ga_domain='xyz.com', email='*****@*****.**').put()
     self.assertEquals(False, users.Get('1').welcome_message_dismissed)
     users.SetWelcomeMessageDismissed('1', True)
     self.assertEquals(True, users.Get('1').welcome_message_dismissed)
Beispiel #6
0
 def testSetWelcomeMessageDismissed(self):
   users._UserModel(id='1', ga_domain='xyz.com', email='*****@*****.**').put()
   self.assertEquals(False, users.Get('1').welcome_message_dismissed)
   users.SetWelcomeMessageDismissed('1', True)
   self.assertEquals(True, users.Get('1').welcome_message_dismissed)