def create_sample_featured_app(self, component): """ Helper method created in order to populate the table 'FeaturedApp' """ sample_featured_app = FeaturedApp() sample_featured_app.component = component sample_featured_app.save() return sample_featured_app
def test_create_featured_app(self): """ Tests the creation of a FeaturedApp """ sample_component = self.create_sample_component( type_id="firefox.desktop") first_featured_app = FeaturedApp() first_featured_app.component = sample_component first_featured_app.save() sample_component = self.create_sample_component( type_id="ardour.desktop") second_featured_app = FeaturedApp() second_featured_app.component = sample_component second_featured_app.save() saved_featured_apps = FeaturedApp.objects.all() self.assertEqual(saved_featured_apps.count(), 2)
def test_create_featured_app(self): """ Tests the creation of a FeaturedApp """ sample_component =self.create_sample_component( type_id="firefox.desktop" ) first_featured_app = FeaturedApp() first_featured_app.component = sample_component first_featured_app.save() sample_component = self.create_sample_component( type_id="ardour.desktop" ) second_featured_app = FeaturedApp() second_featured_app.component = sample_component second_featured_app.save() saved_featured_apps = FeaturedApp.objects.all() self.assertEqual(saved_featured_apps.count(), 2)