Beispiel #1
0
 def test_listOffering(self):
     """
     Mantissa offerings are added as users with a 'username' but no domain.
     Check that the 'list' command prints these correctly.
     """
     name = 'offering-name'
     self.userbase('install')
     realm = IRealm(self.store)
     substoreItem = SubStore.createNew(self.store, ('app', name))
     realm.addAccount(name, None, None, internal=True, avatars=substoreItem)
     output = self.userbase('list')
     self.assertEquals(output, [name])
Beispiel #2
0
 def test_listOffering(self):
     """
     Mantissa offerings are added as users with a 'username' but no domain.
     Check that the 'list' command prints these correctly.
     """
     name = 'offering-name'
     self.userbase('install')
     realm = IRealm(self.store)
     substoreItem = SubStore.createNew(self.store, ('app', name))
     realm.addAccount(name, None, None, internal=True,
                      avatars=substoreItem)
     output = self.userbase('list')
     self.assertEqual(output, [name])
Beispiel #3
0
 def claim(self):
     if not self.claimed:
         log.msg("Claiming a ticket for the first time for %r" % (self.email,))
         username, domain = self.email.split('@', 1)
         realm = IRealm(self.store)
         acct = realm.accountByAddress(username, domain)
         if acct is None:
             acct = realm.addAccount(username, domain, None)
         self.avatar = acct
         self.claimed += 1
         self.booth.ticketClaimed(self)
         self.product.installProductOn(IBeneficiary(self.avatar))
     else:
         log.msg("Ignoring re-claim of ticket for: %r" % (self.email,))
     return self.avatar
Beispiel #4
0
 def claim(self):
     if not self.claimed:
         log.msg("Claiming a ticket for the first time for %r" %
                 (self.email, ))
         username, domain = self.email.split('@', 1)
         realm = IRealm(self.store)
         acct = realm.accountByAddress(username, domain)
         if acct is None:
             acct = realm.addAccount(username, domain, None)
         self.avatar = acct
         self.claimed += 1
         self.booth.ticketClaimed(self)
         self.product.installProductOn(IBeneficiary(self.avatar))
     else:
         log.msg("Ignoring re-claim of ticket for: %r" % (self.email, ))
     return self.avatar