class JsonDataViewTestCase(TestCase, MyTestCaseHelper):

    def __init__(self, methodName):
        super(JsonDataViewTestCase, self).__init__(methodName)
        self.test_helper = MyTestHelper()

    def setUp(self):
        self.setup_environment()

    def test_data_values_facility_period_data_element_unique_together(self):
        self.test_helper.create_data_value(self.org_unit_data, self.rdt_data_element, self.positive_under5, self.data_set,
                                           201505, 10, AgeGroups.under_5_years)

        error_occurred = False
        try:
            self.test_helper.create_data_value(self.org_unit_data, self.rdt_data_element, self.positive_under5,
                                               self.data_set, 201505, 10, AgeGroups.under_5_years)

        except Exception, e:
            # print e.message
            error_occurred = True

        self.assertTrue(error_occurred)