Your code will only work with fields that are string, since numeric and date fields cannot be concatenated directly with the comma or each other. You would have to make line 15 read value = str(row[0]) + "," + str(row[1]). Additionally if you wish to sort the unique values with the sorted() function, your values will only be correctly sorted for string values and will be incorrectly sorted for numeric or date values. I would not accept an unsorted list of unique values for my own applications or uses.
You should reverse your field test logic to set the fieldsExist to False if any field does not exist when dealing with a list of fields. You should be able to make your valueList a list of lists so that you do not need to do concatenation and can handle however many values come at you without any separate code. The list of lists can also be sorted correctly for each field type (although I have converted the interior list to a tuple, since lists don't work for some functions). The last couple of lines may have to be revised to run through the list of lists and add a comma separator after sorting (I did not test the code, but above the last two lines it should all work):
fields = [testField1, testField2] # list can contain any number of fields
# Make sure all fields are upper case
for i in range(fields):
fields = fields.upper()
with open ("myTextFile.txt", "a") as text_file:
fcs = arcpy.ListFeatureClasses()
for fc in fcs:
fieldList = arcpy.ListFields(fc)
fieldsExists = True
for field in fieldList:
if not field.name.upper() in fields:
fieldsExists = False
valueList = []
# test all fields exist and append values to valueList
if (fieldsExists):
with arcpy.da.SearchCursor(fc, fields) as cursor:
for row in cursor:
fieldValues = []
for i in range(fields):
fieldValues.append(row)
valueList.append(tuple(fieldValues))
else:
print fc + " no valid fields"
uniqueValues = sorted(set(valueList))
text_file.write('{}'.format('\n'.join(uniqueValues)))
text_file.write('\n')