def test_translated(self):
    bylicense30ported = LicenseFactory(license_code='by-nc', version='3.0', jurisdiction_code='ar')
    bylicense30unported = LicenseFactory(license_code='by-nc', version='3.0', jurisdiction_code='')
    bylicense40 = LicenseFactory(license_code='by-nc', version='4.0', jurisdiction_code='')
    cc0v1license = LicenseFactory(license_code='CC0', version='1.0', jurisdiction_code='')
    should_be_translated = [LegalCodeFactory(license=bylicense40), LegalCodeFactory(license=cc0v1license)]
    should_not_be_translated = [LegalCodeFactory(license=bylicense30ported), LegalCodeFactory(license=bylicense30unported)]
    self.assertCountEqual(should_be_translated, list(LegalCode.objects.translated()))
    self.assertCountEqual(should_not_be_translated, (set(LegalCode.objects.all()) - set(LegalCode.objects.translated())))
def test_translated(self):
    bylicense30ported = LicenseFactory(license_code='by-nc', version='3.0', jurisdiction_code='ar')
    bylicense30unported = LicenseFactory(license_code='by-nc', version='3.0', jurisdiction_code=)
    bylicense40 = LicenseFactory(license_code='by-nc', version='4.0', jurisdiction_code=)
    cc0v1license = LicenseFactory(license_code='CC0', version='1.0', jurisdiction_code=)
    should_be_translated = [LegalCodeFactory(license=bylicense40), LegalCodeFactory(license=cc0v1license)]
    should_not_be_translated = [LegalCodeFactory(license=bylicense30ported), LegalCodeFactory(license=bylicense30unported)]
    self.assertCountEqual(should_be_translated, list(LegalCode.objects.translated()))
    self.assertCountEqual(should_not_be_translated, (set(LegalCode.objects.all()) - set(LegalCode.objects.translated())))