Example #1
0
 def _dup_test(self, snippet):
     snippet.client_match_rules.add(*ClientMatchRuleFactory.create_batch(3))
     snippet_copy = snippet.duplicate()
     eq_(snippet_copy.disabled, True)
     ok_(snippet_copy.id != snippet.id)
     eq_(snippet_copy.locale_set.count(), 1)
     ok_(snippet_copy.locale_set.all()[0] != snippet.locale_set.all()[0])
     eq_(set(snippet_copy.client_match_rules.all()), set(snippet.client_match_rules.all()))
 def _dup_test(self, snippet):
     snippet.client_match_rules.add(*ClientMatchRuleFactory.create_batch(3))
     snippet_copy = snippet.duplicate()
     self.assertEqual(snippet_copy.disabled, True)
     self.assertTrue(snippet_copy.id != snippet.id)
     self.assertEqual(snippet_copy.locales.count(), 1)
     self.assertTrue(snippet_copy.locales.all()[0] == snippet.locales.all()[0])
     self.assertEqual(set(snippet_copy.client_match_rules.all()),
                      set(snippet.client_match_rules.all()))
Example #3
0
 def _dup_test(self, snippet):
     snippet.client_match_rules.add(*ClientMatchRuleFactory.create_batch(3))
     snippet_copy = snippet.duplicate()
     self.assertEqual(snippet_copy.disabled, True)
     self.assertTrue(snippet_copy.id != snippet.id)
     self.assertEqual(snippet_copy.locales.count(), 1)
     self.assertTrue(
         snippet_copy.locales.all()[0] == snippet.locales.all()[0])
     self.assertEqual(set(snippet_copy.client_match_rules.all()),
                      set(snippet.client_match_rules.all()))
    def _dup_test(self, snippet):
        user = UserFactory.create()
        snippet.client_match_rules.add(*ClientMatchRuleFactory.create_batch(3))
        snippet_copy = snippet.duplicate(user)
        self.assertEqual(snippet_copy.published, False)
        self.assertNotEqual(snippet_copy.id, snippet.id)
        self.assertEqual(snippet_copy.locales.count(), 1)
        self.assertTrue(
            snippet_copy.locales.all()[0] == snippet.locales.all()[0])
        self.assertEqual(set(snippet_copy.client_match_rules.all()),
                         set(snippet.client_match_rules.all()))

        self.assertNotEqual(snippet_copy.creator, snippet.creator)