def test_add_parent(self): cat1 = models.SportCategory(name='Ball') cat2 = models.SportCategory(name='Basket Ball') cat2.add_parent(cat1) cat3 = models.SportCategory(name='Extreme Basket Ball') cat3.add_parent(cat2) assert cat2.paths[0] == 'ball' assert cat1.key in cat2.parents assert cat3.paths[0] == 'ball/basket ball' assert cat2.key in cat3.parents
def setup(self): super(TestGameComments, self).setup() self.user = User(first_name="Adrian", full_name="Adrian Letchford") self.user.put() self.cat = models.SportCategory(name='Basketball') self.cat.put()
def setup(self): super(TestGameModel, self).setup() self.user = usermodels.User(full_name='Rowan Atkinson', first_name="Rowan") self.user.put() self.cat = models.SportCategory(name='Basketball') self.cat.put()
def test(self): cat = models.SportCategory(name='Cycling') cat.put() categories = models.SportCategory.get_all() assert len(categories) == 1 assert categories[0].name == 'Cycling'
def testRetrieveByFullName(self): cat = models.SportCategory(name='Basket Ball') cat.put() retrieved_cat = models.SportCategory.get_by_name('Basket Ball') assert retrieved_cat == cat
def testBasicPut(self): cat = models.SportCategory(name='Basket Ball') cat.put()
def testEmptyPut(self): cat = models.SportCategory() cat.put()